コード例 #1
0
 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)
コード例 #2
0
 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)
コード例 #3
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)
コード例 #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)
コード例 #5
0
ファイル: test_loaders.py プロジェクト: DramaFever/sst
    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()
コード例 #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()
コード例 #7
0
 def setUp(self):
     super(TestConsoleOutput, self).setUp()
     tests.set_cwd_to_tmp(self)
コード例 #8
0
 def setUp(self):
     super(TestXmlOutput, self).setUp()
     tests.set_cwd_to_tmp(self)
コード例 #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)
コード例 #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)
コード例 #11
0
 def setUp(self):
     super(TestWriteTree, self).setUp()
     tests.set_cwd_to_tmp(self)
コード例 #12
0
 def setUp(self):
     super(TestHandleExceptions, self).setUp()
     tests.set_cwd_to_tmp(self)
     self.result = testtools.TestResult()
コード例 #13
0
 def setUp(self):
     super(TestHandleExceptions, self).setUp()
     tests.set_cwd_to_tmp(self)
     self.result = testtools.TestResult()
コード例 #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)
コード例 #15
0
ファイル: test_write_tree.py プロジェクト: DramaFever/sst
 def setUp(self):
     super(TestWriteTree, self).setUp()
     tests.set_cwd_to_tmp(self)
コード例 #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)
コード例 #17
0
 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)
コード例 #18
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)
コード例 #19
0
 def setUp(self):
     super(TestLoadScript, self).setUp()
     tests.set_cwd_to_tmp(self)
コード例 #20
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)
コード例 #21
0
 def setUp(self):
     super(TestFindCases, self).setUp()
     tests.set_cwd_to_tmp(self)
     self.cases_dir = os.path.join(self.test_base_dir, 'cases')
コード例 #22
0
 def setUp(self):
     super(TestResultsDirectory, self).setUp()
     tests.set_cwd_to_tmp(self)
コード例 #23
0
 def setUp(self):
     super(TestLoadScript, self).setUp()
     tests.set_cwd_to_tmp(self)
コード例 #24
0
ファイル: test_sst_run.py プロジェクト: DramaFever/sst
 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)
コード例 #25
0
 def setUp(self):
     super(TestResultsDirectory, self).setUp()
     tests.set_cwd_to_tmp(self)
コード例 #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)
コード例 #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)