Ejemplo n.º 1
0
    def test_method2op_unexpected(self):
        e = None
        try:
            method2op("haha")
        except ValueError as e:
            pass

        self.assertIsNotNone(e)
Ejemplo n.º 2
0
    def test_method2op_unexpected(self):
        from schema_sugar import method2op

        e = None
        try:
            method2op("haha")
        except ValueError as e:
            pass

        self.assertIsNotNone(e)
Ejemplo n.º 3
0
 def test_method2op_name_conv(self):
     input_values = [
         "get", "put", "post", "delete",
         "show", "update", "create", "delete",
     ]
     expect_values = [
         "show", "update", "create", "delete",
         "show", "update", "create", "delete",
     ]
     for input_value, expect_value in zip(input_values, expect_values):
         self.assertEqual(method2op(input_value), expect_value)
Ejemplo n.º 4
0
 def test_method2op_letter_case(self):
     from schema_sugar import method2op
     self.assertEqual(method2op("GET"), "show")
     self.assertEqual(method2op("get"), "show")
     self.assertEqual(method2op("Show"), "show")
Ejemplo n.º 5
0
 def test_method2op_letter_case(self):
     self.assertEqual(method2op("GET"), "show")
     self.assertEqual(method2op("get"), "show")
     self.assertEqual(method2op("Show"), "show")