def test_discover_nothing(self):
     tests.set_cwd_to_tmp(self)
     with open('foo', 'w') as f:
         f.write('bar\n')
     file_loader = loader.FileLoader(self.get_test_loader())
     suite = file_loader.discover('.', 'foo')
     self.assertIs(None, suite)
 def test_discover_nothing(self):
     tests.set_cwd_to_tmp(self)
     with open('foo', 'w') as f:
         f.write('bar\n')
     file_loader = loader.FileLoader(self.get_test_loader())
     suite = file_loader.discover('.', 'foo')
     self.assertIs(None, suite)
    def test_sys_path_restored(self):
        tests.set_cwd_to_tmp(self)
        inserted = self.test_base_dir
        self.assertFalse(inserted in sys.path)

        class Test(testtools.TestCase):
            def test_it(self):
                tests.protect_imports(self)
                sys.path.insert(0, inserted)

        self.run_successful_test(Test('test_it'))
        self.assertFalse(inserted in sys.path)
Exemplo n.º 4
0
    def test_sys_path_restored(self):
        tests.set_cwd_to_tmp(self)
        inserted = self.test_base_dir
        self.assertFalse(inserted in sys.path)

        class Test(testtools.TestCase):

            def test_it(self):
                tests.protect_imports(self)
                sys.path.insert(0, inserted)
        self.run_successful_test(Test('test_it'))
        self.assertFalse(inserted in sys.path)
Exemplo n.º 5
0
    def setUp(self):
        super(TestTestLoaderTopLevelDir, self).setUp()
        # We build trees rooted in test_base_dir from which we will import
        tests.set_cwd_to_tmp(self)
        tests.protect_imports(self)
        tests.write_tree_from_desc('''dir: t
file: t/__init__.py
file: t/foo.py
import unittest

class Test(unittest.TestCase):

    def test_me(self):
      self.assertTrue(True)
''')
        self.loader = loaders.TestLoader()
Exemplo n.º 6
0
    def setUp(self):
        super(TestTestLoaderTopLevelDir, self).setUp()
        # We build trees rooted in test_base_dir from which we will import
        tests.set_cwd_to_tmp(self)
        tests.protect_imports(self)
        tests.write_tree_from_desc('''dir: t
file: t/__init__.py
file: t/foo.py
import unittest

class Test(unittest.TestCase):

    def test_me(self):
      self.assertTrue(True)
''')
        self.loader = loaders.TestLoader()
Exemplo n.º 7
0
 def setUp(self):
     super(TestConsoleOutput, self).setUp()
     tests.set_cwd_to_tmp(self)
Exemplo n.º 8
0
 def setUp(self):
     super(TestXmlOutput, self).setUp()
     tests.set_cwd_to_tmp(self)
Exemplo n.º 9
0
 def setUp(self):
     super(TestDjangoDevServer, self).setUp()
     # capture test output so we don't pollute the test runs
     self.out = StringIO()
     self.patch(sys, 'stdout', self.out)
     tests.set_cwd_to_tmp(self)
Exemplo n.º 10
0
 def setUp(self):
     super(TestScreenShotsAndPageDump, self).setUp()
     tests.set_cwd_to_tmp(self)
     # capture test output so we don't pollute the test runs
     self.out = StringIO()
     self.patch(sys, 'stdout', self.out)
 def setUp(self):
     super(TestWriteTree, self).setUp()
     tests.set_cwd_to_tmp(self)
Exemplo n.º 12
0
 def setUp(self):
     super(TestHandleExceptions, self).setUp()
     tests.set_cwd_to_tmp(self)
     self.result = testtools.TestResult()
 def setUp(self):
     super(TestHandleExceptions, self).setUp()
     tests.set_cwd_to_tmp(self)
     self.result = testtools.TestResult()
Exemplo n.º 14
0
 def setUp(self):
     super(TestDjangoDevServer, self).setUp()
     # We should not rely on the current directory being the root of the sst
     # project, the best way to achieve that is to change to a newly created
     # one.
     tests.set_cwd_to_tmp(self)
Exemplo n.º 15
0
 def setUp(self):
     super(TestWriteTree, self).setUp()
     tests.set_cwd_to_tmp(self)
Exemplo n.º 16
0
 def setUp(self):
     super(TestScreenShotsAndPageDump, self).setUp()
     tests.set_cwd_to_tmp(self)
     # capture test output so we don't pollute the test runs
     self.out = StringIO()
     self.patch(sys, 'stdout', self.out)
 def setUp(self):
     super(TestSSTScriptTestCaseFailureScreenShots, self).setUp()
     tests.set_cwd_to_tmp(self)
     # capture test output so we don't pollute the test runs
     self.out = StringIO()
     self.patch(sys, "stdout", self.out)
 def setUp(self):
     super(TestTestLoaderTopLevelDir, self).setUp()
     # We build trees rooted in test_base_dir from which we will import
     tests.set_cwd_to_tmp(self)
     tests.protect_imports(self)
 def setUp(self):
     super(TestLoadScript, self).setUp()
     tests.set_cwd_to_tmp(self)
 def setUp(self):
     super(TestTestLoaderTopLevelDir, self).setUp()
     # We build trees rooted in test_base_dir from which we will import
     tests.set_cwd_to_tmp(self)
     tests.protect_imports(self)
 def setUp(self):
     super(TestFindCases, self).setUp()
     tests.set_cwd_to_tmp(self)
     self.cases_dir = os.path.join(self.test_base_dir, 'cases')
 def setUp(self):
     super(TestResultsDirectory, self).setUp()
     tests.set_cwd_to_tmp(self)
 def setUp(self):
     super(TestLoadScript, self).setUp()
     tests.set_cwd_to_tmp(self)
Exemplo n.º 24
0
 def setUp(self):
     super(TestSSTTestCase, self).setUp()
     tests.set_cwd_to_tmp(self)
     self.test = tests.SSTBrowserLessTestCase('run')
     self.result = testtools.TestResult()
     self.test.run(self.result)
Exemplo n.º 25
0
 def setUp(self):
     super(TestResultsDirectory, self).setUp()
     tests.set_cwd_to_tmp(self)
Exemplo n.º 26
0
 def setUp(self):
     super(TestDjangoDevServer, self).setUp()
     # We should not rely on the current directory being the root of the sst
     # project, the best way to achieve that is to change to a newly created
     # one.
     tests.set_cwd_to_tmp(self)
Exemplo n.º 27
0
 def setUp(self):
     super(TestSSTTestCase, self).setUp()
     tests.set_cwd_to_tmp(self)
     self.test = tests.SSTBrowserLessTestCase('run')
     self.result = testtools.TestResult()
     self.test.run(self.result)