Exemplo n.º 1
0
    def test_should_save_data_when_speed_is_greater_than_10kmh(self):
        # Speed 11.03 km/h
        when(GPS).getActualPosition().thenReturn('225109.000,1545.1554S,04752.9177W,0.6,1066.3,3,190.05,11.03,0.01,261010,10')
        main.loop(self.log_file)

        # Reopens the file -- only for read
        self.log_file = self.log_file = open(main.GPS_LOG_FILE_NAME, 'r')
        
        self.assertEqual(self.log_file.readline(), '225109.000,1545.1554S,04752.9177W,3,190.05,11.03\n')
Exemplo n.º 2
0
    def test_should_validate_minimum_speed(self):
        # Speed 0.03 km/h
        when(GPS).getActualPosition().thenReturn('225109.000,1545.1554S,04752.9177W,0.6,1066.3,3,190.05,0.03,0.01,261010,10')
        main.loop(self.log_file)

        # Reopens the file -- only for read
        self.log_file = self.log_file = open(main.GPS_LOG_FILE_NAME, 'r')
        
        self.assertEqual(self.log_file.readline(), '')