Example #1
0
class TestBaseWorkflowTypeQuerySet(unittest.TestCase):
    def setUp(self):
        self.domain = Domain("TestDomain")
        self.bw = BaseWorkflowQuerySet(self.domain)

    def tearDown(self):
        pass

    def test_get_domain_property_instantiates_private_attribute(self):
        bw = BaseWorkflowQuerySet(self.domain)
        delattr(bw, '_domain')
        dummy = bw.domain

        self.assertTrue(hasattr(bw, '_domain'))

    def test_instantiation_with_valid_domain(self):
        bw = BaseWorkflowQuerySet(self.domain)

        self.assertIsInstance(bw.domain, Domain)
        self.assertEqual(bw._domain, bw.domain)

    def test_instantiation_with_invalid_domain(self):
        with self.assertRaises(TypeError):
            BaseWorkflowQuerySet("WrongType")

    def test__list_isnt_implemented(self):
        with self.assertRaises(NotImplementedError):
            self.bw._list()
class TestBaseWorkflowTypeQuerySet(unittest.TestCase):

    def setUp(self):
        self.domain = Domain("TestDomain")
        self.bw = BaseWorkflowQuerySet(self.domain)

    def tearDown(self):
        pass

    def test_get_domain_property_instantiates_private_attribute(self):
        bw = BaseWorkflowQuerySet(self.domain)
        delattr(bw, '_domain')
        bw.domain

        self.assertTrue(hasattr(bw, '_domain'))

    def test_instantiation_with_valid_domain(self):
        bw = BaseWorkflowQuerySet(self.domain)

        self.assertIsInstance(bw.domain, Domain)
        self.assertEqual(bw._domain, bw.domain)

    def test_instantiation_with_invalid_domain(self):
        with self.assertRaises(TypeError):
            BaseWorkflowQuerySet("WrongType")

    def test__list_isnt_implemented(self):
        with self.assertRaises(NotImplementedError):
            self.bw._list()
Example #3
0
 def test_instantiation_with_invalid_domain(self):
     with self.assertRaises(TypeError):
         BaseWorkflowQuerySet("WrongType")
Example #4
0
    def test_instantiation_with_valid_domain(self):
        bw = BaseWorkflowQuerySet(self.domain)

        self.assertIsInstance(bw.domain, Domain)
        self.assertEqual(bw._domain, bw.domain)
Example #5
0
    def test_get_domain_property_instantiates_private_attribute(self):
        bw = BaseWorkflowQuerySet(self.domain)
        delattr(bw, '_domain')
        dummy = bw.domain

        self.assertTrue(hasattr(bw, '_domain'))
Example #6
0
 def setUp(self):
     self.domain = Domain("TestDomain")
     self.bw = BaseWorkflowQuerySet(self.domain)
 def setUp(self):
     self.domain = Domain("TestDomain")
     self.bw = BaseWorkflowQuerySet(self.domain)