コード例 #1
0
class TestA(TestK):
    def setUp(self):
        self.attr = Attr('mykey')
        self.attr2 = Attr('myotherkey')
        self.value = 'foo'
        self.value2 = 'foo2'

    def test_ne(self):
        self.assertEqual(self.attr.ne(self.value),
                         NotEquals(self.attr, self.value))

    def test_is_in(self):
        self.assertEqual(self.attr.is_in([self.value]),
                         In(self.attr, [self.value]))

    def test_exists(self):
        self.assertEqual(self.attr.exists(), AttributeExists(self.attr))

    def test_not_exists(self):
        self.assertEqual(self.attr.not_exists(), AttributeNotExists(self.attr))

    def test_contains(self):
        self.assertEqual(self.attr.contains(self.value),
                         Contains(self.attr, self.value))

    def test_size(self):
        self.assertEqual(self.attr.size(), Size(self.attr))

    def test_attribute_type(self):
        self.assertEqual(self.attr.attribute_type(self.value),
                         AttributeType(self.attr, self.value))
コード例 #2
0
 def test_build_size_with_other_conditons(self):
     a = Attr('myattr')
     self.assert_condition_expression_build(a.size().eq(5),
                                            'size(#n0) = :v0',
                                            {'#n0': 'myattr'}, {':v0': 5})
コード例 #3
0
 def test_build_size(self):
     a = Attr('myattr')
     self.assert_condition_expression_build(a.size(), 'size(#n0)',
                                            {'#n0': 'myattr'}, {})