Esempio n. 1
0
    def test_load_street_types_no_space_end_of_line(self):
        temp_dir = Path(tempfile.mkdtemp())
        temp_file = Path(temp_dir, 'test.txt')
        temp_file.write_file('VILLAGE VILL VLG\n')

        StreetType.load_street_types(temp_file.absolute())

        temp_dir.rmtree()

        self.assertEqual('VILLAGE VILL', StreetType.objects.first().name)
        self.assertEqual('VLG', StreetType.objects.first().abbreviation)
    def handle(self, *args, **options):
        directionals_path = Path(self.BASE_DIR, 'directionals.txt')
        if directionals_path.exists():
            Directional.load_directionals(directionals_path)

        states_path = Path(self.BASE_DIR, 'states.txt')
        if states_path.exists():
            State.load_states(states_path)

        street_types_path = Path(self.BASE_DIR, 'street_types.txt')
        if street_types_path.exists():
            StreetType.load_street_types(street_types_path)