Exemple #1
0
    def test_read_max_valid_value(self):
        self.presentation = presenter.Presentation(time_frame='year',
                                                   to_time=self.demo_to_time)
        self.presentation.add_datasource(self.test_data[0])
        result = self.presentation.max()

        expected_max = 11861200.31
        self.assertTrue((expected_max - result[0]) <= 0.1)
Exemple #2
0
    def test_read_sum_valid_value(self):
        self.presentation = presenter.Presentation(time_frame='year',
                                                   to_time=self.demo_to_time)
        self.presentation.add_datasource(self.test_data[0])
        result = self.presentation.sum()

        expected_sum = 856394975.68

        self.assertTrue((expected_sum - result[0]) <= 0.1)
Exemple #3
0
    def test_read_min_valid_value(self):
        self.presentation = presenter.Presentation(time_frame='year',
                                                   to_time=self.demo_to_time)
        self.presentation.add_datasource(self.test_data[0])
        result = self.presentation.min()

        expected_min = 902148.62

        self.assertTrue((expected_min - result[0]) <= 0.1)
Exemple #4
0
    def test_valid_points_valid_value(self):
        self.presentation = presenter.Presentation(time_frame='year',
                                                   to_time=self.demo_to_time)
        self.presentation.add_datasource(self.test_data[0])

        result = self.presentation.valid_points()

        self.assertEquals(1, len(result))
        self.assertEquals([[361, 0, 0.0]], result)
Exemple #5
0
    def setUp(self):
        self.demo_to_time = '1340633399'

        self.presentation = presenter.Presentation(to_time=self.demo_to_time)

        self.path = os.path.dirname(inspect.getfile(inspect.currentframe()))

        self.test_data = []
        for i in xrange(0, 10):
            self.test_data.append(self._create_datasource(i))
Exemple #6
0
    def test_read_average_valid_value(self):
        self.presentation = presenter.Presentation(time_frame='year',
                                                   to_time=self.demo_to_time)
        self.presentation.add_datasource(self.test_data[0])
        result = self.presentation.average()
        self.assertEquals(1, len(result))

        self.assertEquals(list, type(result))

        expected_average = 2372285.25
        self.assertTrue((expected_average - result[0]) <= 0.1)