# Python lib import import unittest import os import sys # If we run test in the tests directory import parent folder if(not os.path.exists('export.py')): sys.path.insert(0,'..') # The class to test from export import RoundupExport class IssueTest(unittest.TestCase): def setUp(self): self.export = RoundupExport() def testInstanceLocation(self): self.export.instanceLocation = '../tests' self.assertEqual(self.export.instanceLocation, '../tests') self.assertRaises(ValueError, self.export.setInstanceLocation, '../testsDummyInstanceLocationThatDoesntExistAtAll') def test_suite(): from unittest import TestSuite, makeSuite suite = TestSuite() suite.addTest(makeSuite(IssueTest)) return suite if __name__ == '__main__': unittest.main()