def test_returns_all_tests_when_there_is_no_database(self, Database): suite = self.get_suite('flat') filtered, full_suite = filter_suite(suite, None) full_suite | should | be(True) map(str, filtered) | should | each_be_equal_to(map(str, suite))
def test_returns_all_tests_when_there_is_no_database(self, Database): suite = self.get_suite('flat') filtered, full_suite = filter_suite(suite, None) full_suite |should| be(True) map(str, filtered) |should| each_be_equal_to(map(str, suite))
def test_returns_all_tests_when_candidates_empty(self, Database): suite = self.get_suite('flat') db = Database() db.candidates = mock.Mock('candidates', return_value=set()) filtered, full_suite = filter_suite(suite, db) full_suite | should | be(True) map(str, filtered) | should | each_be_equal_to(map(str, suite))
def test_returns_TestSuite_instance(self, Database): suite = self.get_suite('flat') candidates = list(map(str, suite))[:1] db = Database() db.candidates = mock.Mock('candidates', return_value=set(candidates)) filtered, full_suite = filter_suite(suite, db) filtered | should | be_instance_of(unittest.TestSuite)
def test_returns_all_tests_when_candidates_empty(self, Database): suite = self.get_suite('flat') db = Database() db.candidates = mock.Mock('candidates', return_value=set()) filtered, full_suite = filter_suite(suite, db) full_suite |should| be(True) map(str, filtered) |should| each_be_equal_to(map(str, suite))
def test_returns_TestSuite_instance(self, Database): suite = self.get_suite('flat') candidates = list(map(str, suite))[:1] db = Database() db.candidates = mock.Mock('candidates', return_value=set(candidates)) filtered, full_suite = filter_suite(suite, db) filtered |should| be_instance_of(unittest.TestSuite)
def test_returns_only_tests_that_are_candidates_if_there_are_candidates(self, Database): # noqa suite = self.get_suite('flat') candidates = ['test_two (%s.Test_flat)' % __name__] db = Database() db.candidates = mock.Mock('candidates', return_value=set(candidates)) filtered, full_suite = filter_suite(suite, db) full_suite |should| be(False) map(str, filtered) |should| each_be_equal_to(candidates)
def test_returns_only_tests_that_are_candidates_if_there_are_candidates( self, Database): # noqa suite = self.get_suite('flat') candidates = ['test_two (%s.Test_flat)' % __name__] db = Database() db.candidates = mock.Mock('candidates', return_value=set(candidates)) filtered, full_suite = filter_suite(suite, db) full_suite | should | be(False) map(str, filtered) | should | each_be_equal_to(candidates)