def test_string__with_whitespace(self): self.assertFalse(__unit__.has_identifier_form('foo bar')) self.assertFalse(__unit__.has_identifier_form('foo\tbar'))
def test_string__underscore_prefix(self): self.assertTrue(__unit__.has_identifier_form('_42'))
def test_string__letters(self): self.assertTrue(__unit__.has_identifier_form('foo'))
def test_string__empty(self): self.assertFalse(__unit__.has_identifier_form(''))
def test_string__number_prefix(self): self.assertFalse(__unit__.has_identifier_form('42foo'))
def test_some_object(self): with self.assertRaises(TypeError): __unit__.has_identifier_form(object())
def test_string__camel_case(self): self.assertTrue(__unit__.has_identifier_form('FooBar')) self.assertTrue(__unit__.has_identifier_form('fooBar'))
def test_string__snake_case(self): self.assertTrue(__unit__.has_identifier_form('foo_bar'))
def test_none(self): with self.assertRaises(TypeError): __unit__.has_identifier_form(None)