Пример #1
0
    def test_initalism_is_capitalized_when_camel_case(self, mock_file):
        name_parser_factory = NameParserFactory()
        name_parser_factory.set_template_path("random/path")
        name = name_parser_factory.create("fileUrl")

        self.assertEqual("FileURL", name.upper_camel_case)
        self.assertEqual("fileURL", name.lower_camel_case)
Пример #2
0
    def test_initalism_is_not_capitalized_when_lower_snake_case(
            self, mock_file):
        name_parser_factory = NameParserFactory()
        name_parser_factory.set_template_path("random/path")
        name = name_parser_factory.create("fileUrl")

        self.assertEqual("file_url", name.lower_snake_case)
Пример #3
0
    def test_no_initialisms_when_no_initialims_file(self, mock_file):
        mock_file.side_effect = FileNotFoundError()
        name_parser_factory = NameParserFactory()
        name = name_parser_factory.create("fileUrl")

        self.assertEqual("FileUrl", name.upper_camel_case)
        self.assertEqual("fileUrl", name.lower_camel_case)
        self.assertEqual("file_url", name.lower_snake_case)
        self.assertEqual("File_Url", name.upper_snake_case)