Exemplo n.º 1
0
    def test_repr__names_only__several(self):
        attrs = __unit__.Attrs('foo', 'bar')

        r = "%r" % attrs
        self.assertIn("foo", r)
        self.assertIn("bar", r)
        self.assertNotIn("=", r)
Exemplo n.º 2
0
    def test_repr__values_only__several(self):
        attrs = __unit__.Attrs(foo=self.VALUE, bar=self.VALUE * 2)

        r = "%r" % attrs
        self.assertIn("foo=", r)
        self.assertIn("bar=", r)
        self.assertIn("%r" % self.VALUE, r)
Exemplo n.º 3
0
    def test_repr__both__one_each(self):
        attrs = __unit__.Attrs('bar', foo=self.VALUE)

        r = "%r" % attrs
        self.assertIn("bar", r)
        self.assertNotIn("bar=", r)  # because this one doesn't have a value
        self.assertIn("foo=", r)
        self.assertIn("%r" % self.VALUE, r)
Exemplo n.º 4
0
    def test_repr__both__mix(self):
        attrs = __unit__.Attrs('bar', 'baz', foo=self.VALUE)

        r = "%r" % attrs
        self.assertIn("bar", r)
        self.assertNotIn("bar=", r)
        self.assertIn("baz", r)
        self.assertNotIn("baz=", r)
        self.assertIn("%r" % self.VALUE, r)
Exemplo n.º 5
0
    def test_repr__values_only__one(self):
        attrs = __unit__.Attrs(foo=self.VALUE)

        r = "%r" % attrs
        self.assertIn("foo=", r)
        self.assertIn("%r" % self.VALUE, r)
Exemplo n.º 6
0
    def test_repr__names_only__one(self):
        attrs = __unit__.Attrs('foo')

        r = "%r" % attrs
        self.assertIn("foo", r)
        self.assertNotIn("=", r)  # because no value was given
Exemplo n.º 7
0
 def assert_no_match(self, value, *args, **kwargs):
     return super(Attrs, self) \
         .assert_no_match(__unit__.Attrs(*args, **kwargs), value)