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)
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)
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)
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)
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)
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
def assert_no_match(self, value, *args, **kwargs): return super(Attrs, self) \ .assert_no_match(__unit__.Attrs(*args, **kwargs), value)