diff --git a/tests/test_buildozer.py b/tests/test_buildozer.py index 327e33e..b47711d 100644 --- a/tests/test_buildozer.py +++ b/tests/test_buildozer.py @@ -1,4 +1,6 @@ +import os import unittest +import buildozer as buildozer_module from buildozer import Buildozer @@ -10,3 +12,15 @@ class TestBuildozer(unittest.TestCase): """ buildozer = Buildozer() self.assertEqual(buildozer.specfilename, 'buildozer.spec') + # spec file doesn't have to exist + self.assertFalse(os.path.exists(buildozer.specfilename)) + + def test_buildozer_read_spec(self): + """ + Initializes Buildozer object from existing spec file. + """ + specfilepath = os.path.join( + os.path.dirname(buildozer_module.__file__), + 'default.spec') + buildozer = Buildozer(filename=specfilepath) + self.assertTrue(os.path.exists(buildozer.specfilename))