From 6865c2d4c5ec3363b9791df55a3da7e8b7d9d25c Mon Sep 17 00:00:00 2001 From: Danimar Ribeiro Date: Sun, 14 Jun 2015 23:09:32 -0300 Subject: [PATCH] Ajeitando testes --- .travis.yml | 7 +++++++ setup.py | 12 +++++------- test/AssinaturaTest.py | 31 ------------------------------- test/__init__.py | 0 tests/AssinaturaTest.py | 31 +++++++++++++++++++++++++++++++ tests/__init__.py | 0 6 files changed, 43 insertions(+), 38 deletions(-) create mode 100644 .travis.yml delete mode 100644 test/AssinaturaTest.py delete mode 100644 test/__init__.py create mode 100644 tests/AssinaturaTest.py create mode 100644 tests/__init__.py diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..6b01369 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,7 @@ +language: python +python: + - "2.7" +install: + - pip install PyXmlSec +script: nosetests + diff --git a/setup.py b/setup.py index d6806ee..eaf2666 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,11 @@ #coding=utf-8 -from setuptools import setup +from setuptools import setup, find_packages setup( name = "PyNfeTrust", version = "0.1", author = "Danimar Ribeiro", author_email = 'danimaribeiro@gmail.com', - test_suite='tests', keywords = ['nfe', 'mdf-e'], classifiers=[ 'Development Status :: 1 - alpha', @@ -17,10 +16,7 @@ setup( 'Programming Language :: Python', 'Topic :: Software Development :: Libraries :: Python Modules', ], - packages = [ - 'pynfe', - 'pynfe.servicos', - ], + packages = find_packages(exclude=['*tests*']), url = 'https://github.com/danimaribeiro/PyNfeTrust', license = 'LGPL-v2.1+', description = 'PyNfeTrust é uma biblioteca para envio de NF-e', @@ -28,7 +24,9 @@ setup( install_requires=[ 'PyXMLSec >= 0.3.0' ], + test_suite='nose.collector', tests_require=[ - 'pyflakes>=0.6.1', + 'nose', + 'mock', ], ) diff --git a/test/AssinaturaTest.py b/test/AssinaturaTest.py deleted file mode 100644 index 4127e7f..0000000 --- a/test/AssinaturaTest.py +++ /dev/null @@ -1,31 +0,0 @@ -#coding=utf-8 -''' -Created on Jun 14, 2015 - -@author: danimar -''' -import unittest -from pytrustnfe.servicos.assinatura import Assinatura - -XML_ASSINAR = '' \ - '' \ - ' ' \ - ' Hello, World!' \ - ' ' \ - '' - -XML_ASSINADO = '' - -class Test(unittest.TestCase): - - def testAssinarXml(self): - - assinatura = Assinatura('/home/danimar/Desktop/INFOGER.pfx', '123456') - - self.assertRaises(RuntimeError, assinatura.assina_xml, XML_ASSINAR) - - -if __name__ == "__main__": - #import sys;sys.argv = ['', 'Test.testName'] - unittest.main() - \ No newline at end of file diff --git a/test/__init__.py b/test/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/tests/AssinaturaTest.py b/tests/AssinaturaTest.py new file mode 100644 index 0000000..4127e7f --- /dev/null +++ b/tests/AssinaturaTest.py @@ -0,0 +1,31 @@ +#coding=utf-8 +''' +Created on Jun 14, 2015 + +@author: danimar +''' +import unittest +from pytrustnfe.servicos.assinatura import Assinatura + +XML_ASSINAR = '' \ + '' \ + ' ' \ + ' Hello, World!' \ + ' ' \ + '' + +XML_ASSINADO = '' + +class Test(unittest.TestCase): + + def testAssinarXml(self): + + assinatura = Assinatura('/home/danimar/Desktop/INFOGER.pfx', '123456') + + self.assertRaises(RuntimeError, assinatura.assina_xml, XML_ASSINAR) + + +if __name__ == "__main__": + #import sys;sys.argv = ['', 'Test.testName'] + unittest.main() + \ No newline at end of file diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29