diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..83b4593 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,15 @@ +sudo: false +language: python +cache: pip +python: + - "2.7" + - "3.4" + +before_install: + - pip install codecov + +script: + - coverage run tests.py + +after_success: + - codecov diff --git a/tests.py b/tests.py new file mode 100644 index 0000000..b7d9845 --- /dev/null +++ b/tests.py @@ -0,0 +1,33 @@ +"""Installer unit tests.""" + +import os +import shutil +import tempfile +import unittest + +import run + + +class ConfigFileTestCase(unittest.TestCase): + """Test configuration file generation.""" + + def setUp(self): + """Create temp dir.""" + self.workdir = tempfile.mkdtemp() + self.cfgfile = os.path.join(self.workdir, "installer.cfg") + + def tearDown(self): + """Delete temp dir.""" + shutil.rmtree(self.workdir) + + def test_configfile_generation(self): + """Check simple case.""" + run.main([ + "--stop-after-configfile-check", + "--configfile", self.cfgfile, + "example.test"]) + self.assertTrue(os.path.exists(self.cfgfile)) + + +if __name__ == "__main__": + unittest.main()