Beispiel #1
0
    def test_none_error(self):
        with self.assertRaises(TypeError):
            nameable_string('none')

        with self.assertRaises(TypeError):
            nameable_string(None)
Beispiel #2
0
    def test_number_start_error(self):
        with self.assertRaises(TypeError):
            nameable_string('1thing')

        with self.assertRaises(TypeError):
            nameable_string('1')
Beispiel #3
0
 def test_empty_error(self):
     with self.assertRaises(TypeError):
         nameable_string('')
Beispiel #4
0
 def test_ok(self):
     lib = 'libName'
     self.assertEqual('libName', nameable_string(lib))
Beispiel #5
0
    def test_space_error(self):
        with self.assertRaises(TypeError):
            nameable_string(' ')

        with self.assertRaises(TypeError):
            nameable_string('thing thing')
Beispiel #6
0
 def test_underscore_error(self):
     with self.assertRaises(TypeError):
         nameable_string('thing_thing')
Beispiel #7
0
 def test_comma_error(self):
     with self.assertRaises(TypeError):
         nameable_string('thing,thing')
Beispiel #8
0
 def test_semicolon_error(self):
     with self.assertRaises(TypeError):
         nameable_string('thing;thing')