Skip to content

Commit

Permalink
Merge pull request #23 from stchris/unicode-literals
Browse files Browse the repository at this point in the history
Better tests
  • Loading branch information
Christian Stefanescu authored Jul 20, 2016
2 parents 5902bcc + 132c80b commit d9e5148
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ untangle.egg-info
.tox/
tox.init
untangle-*.tar.gz
.cache/*
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ language: python
python:
- 2.6
- 2.7
- 3.2
- 3.3
- 3.4
- 3.5
- pypy
install:
- pip install coveralls
script:
script:
coverage run --source=untangle ./setup.py test

after_success:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ compile:
python -m compileall -q untangle.py tests/tests.py

test:
nosetests --exe tests/
tox

# needs python-stdeb
package_deb:
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
untangle
untangle
========

[![Build Status](https://secure.travis-ci.org/stchris/untangle.png?branch=master)](http://travis-ci.org/stchris/untangle) [![Code Quality](https://landscape.io/github/stchris/untangle/master/landscape.png)](https://landscape.io/github/stchris/untangle/master) [![Coverage Status](https://coveralls.io/repos/stchris/untangle/badge.png)](https://coveralls.io/r/stchris/untangle) [![PyPi version](https://img.shields.io/pypi/v/untangle.svg)](https://pypi.python.org/pypi/untangle) [![PyPi downloads](https://img.shields.io/pypi/dm/untangle.svg)](https://pypi.python.org/pypi/untangle)
Expand All @@ -9,12 +9,12 @@ untangle
[Documentation](http://readthedocs.org/docs/untangle/en/latest/)


* Converts XML to a Python object.
* Siblings with similar names are grouped into a list.
* Converts XML to a Python object.
* Siblings with similar names are grouped into a list.
* Children can be accessed with ``parent.child``, attributes with ``element['attribute']``.
* You can call the ``parse()`` method with a filename, an URL or an XML string.
* Substitutes ``-``, ``.`` and ``:`` with ``_`` ``<foobar><foo-bar/></foobar>`` can be accessed with ``foobar.foo_bar``, ``<foo.bar.baz/>`` can be accessed with ``foo_bar_baz`` and ``<foo:bar><foo:baz/></foo:bar>`` can be accessed with ``foo_bar.foo_baz``
* Works with Python 2.4-3.2 and pypy
* Works with Python 2.5, 2.6, 2.7 and 3.3, 3.4, 3.5 and pypy

Installation
------------
Expand Down
8 changes: 6 additions & 2 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ def test_namespace(self):
'compact vam',
template.table.tr.xsl_for_each.td['class']
)
self.assert_(
self.assertEquals(
untangle.Element('',''),
template.table.tr.xsl_for_each.td.xsl_apply_templates
)

Expand All @@ -183,7 +184,10 @@ def test_namespace(self):
'compact tac formula italic',
last_template.p['class']
)
self.assert_(last_template.p.xsl_apply_templates)
self.assertEquals(
untangle.Element('xsl_apply_templates',''),
last_template.p.xsl_apply_templates
)


class IterationTestCase(unittest.TestCase):
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# and then run "tox" from this directory.

[tox]
envlist = py25, py26, py27, py31, py32, py33, py34, pypy
envlist = py25, py26, py27, py33, py34, py35, pypy
skip_missing_interpreters = true

[testenv]
commands = make test
commands = py.test tests/tests.py
deps = pytest

1 change: 0 additions & 1 deletion untangle.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
Author: Christian Stefanescu (http://0chris.com)
License: MIT License - http://www.opensource.org/licenses/mit-license.php
"""

import os
from xml.sax import make_parser, handler
try:
Expand Down

0 comments on commit d9e5148

Please sign in to comment.