예제 #1
0
    def test_get_weather(self):
        if config_service.run_slow_test():
            # when
            result = web_data_gateway.get_weather()

            # debug
            print(result)

            # then
            self.assertNotEqual(result, ['Weather data N/A'])
        else:
            self.skipTest('running fast test only. test_get_weather skipped.')
예제 #2
0
    def test_get_pollution_for(self):
        if config_service.run_slow_test():
            # when
            result = web_data_gateway.get_pollution_for('wroclaw')

            # debug
            print(result)

            # then
            self.assertNotEqual(result, 'Pollution data N/A')
        else:
            self.skipTest(
                'running fast test only. test_get_pollution_for skipped.')
예제 #3
0
    def test_get_o2_status(self):
        if config_service.run_slow_test():
            # when
            result = web_data_gateway.get_o2_status()

            # debug
            print(result)

            # then
            self.assertNotEqual(result, 'o2 data N/A')
        else:
            self.skipTest(
                'running fast test only. test_get_o2_status skipped.')
예제 #4
0
    def test_get_status(self):
        if config_service.run_slow_test():
            # when
            result = web_data_gateway.get_status()

            # debug
            print(result)

            # then
            self.assertTrue('Tube data N/A' not in result)
            self.assertTrue('Train data N/A' not in result)
        else:
            self.skipTest('running fast test only. test_get_status skipped.')
예제 #5
0
    def test_get_data_for_non_working_url_should_return_error(self):
        if config_service.run_slow_test():
            # given
            url = 'http://192.168.0.204:5000/system'

            # when
            result = local_data_gateway.get_data_for(url)

            # then
            if 'error' not in result:
                self.fail()
        else:
            self.skipTest(
                'running fast test only. local_data_gateway.get_data_for skipped.'
            )
예제 #6
0
    def test_network_check_should_return_perfect(self):
        if config_service.run_slow_test():
            # given
            expected_result = {'status': 'Perfect', 'result': '6 of 6 pages were loaded', 'problems': []}

            # when
            result = networkcheck.network_check(False)

            # then
            self.assertEqual(expected_result, result)

            # debug
            print(result)
        else:
            self.skipTest('running fast test only. test_network_check_should_return_perfect skipped.')
예제 #7
0
    def test_run_gc(self):
        if config_service.run_slow_test():
            # given
            memory_available_in_mb = system_data_service.get_memory_available_in_mb()

            # when
            result = delight_service.run_gc()
            self.assertEqual(result['memory_before'], memory_available_in_mb)
            self.assertGreaterEqual(dom_utils.get_int_number_from_text(result['memory_after']),
                                    dom_utils.get_int_number_from_text(memory_available_in_mb))
            self.assertGreaterEqual(result['memory_saved'], 0)

            # debug
            print(result)
        else:
            self.skipTest('running fast test only. test_network_check_should_return_perfect skipped.')