コード例 #1
0
ファイル: test_utils.py プロジェクト: blin/zabby
    def test_returns_up_to_maximum_number_of_lines(self):
        ensure_contains_only_formatted_lines(FILE_PATH, 'line', 3)

        maximum_number_of_lines = 2
        found_lines = lines_from_file(FILE_PATH, maximum_number_of_lines)

        assert_less_equal(maximum_number_of_lines, len(found_lines))
コード例 #2
0
    def test_returns_not_completely_shifted_stats_for_unfilled_history(self):
        self.collector._collect()

        stats, timestamp = self.collector.get_stats(DEVICE_NAME, self.shift,
                                                    self.current_time)
        assert_less_equal(self.shift, self.current_time - timestamp)
        assert_is_instance(stats, DiskDeviceStats)
コード例 #3
0
ファイル: test_collectors.py プロジェクト: blin/zabby
    def test_returns_not_completely_shifted_stats_for_unfilled_history(self):
        self.collector._collect()

        stats, timestamp = self.collector.get_stats(DEVICE_NAME, self.shift,
                                                    self.current_time)
        assert_less_equal(self.shift, self.current_time - timestamp)
        assert_is_instance(stats, DiskDeviceStats)
コード例 #4
0
ファイル: test_utils.py プロジェクト: Bregor/zabby
    def test_returns_up_to_maximum_number_of_lines(self):
        ensure_contains_only_formatted_lines(FILE_PATH, 'line', 3)

        maximum_number_of_lines = 2
        found_lines = lines_from_file(FILE_PATH, maximum_number_of_lines)

        assert_less_equal(maximum_number_of_lines, len(found_lines))
コード例 #5
0
    def test_result_for_all_is_greater_than_for_single_device(self):
        results = list()
        devices = self.host_os.disk_device_names()
        for device in devices:
            result = self.function_under_test(device=device,
                                              host_os=self.host_os)
            results.append(result)

        all_result = self.function_under_test(device='all',
                                              host_os=self.host_os)

        for result in results:
            assert_less_equal(result, all_result)
コード例 #6
0
ファイル: test_dev.py プロジェクト: blin/zabby
    def test_result_for_all_is_greater_than_for_single_device(self):
        results = list()
        devices = self.host_os.disk_device_names()
        for device in devices:
            result = self.function_under_test(device=device,
                                              host_os=self.host_os)
            results.append(result)

        all_result = self.function_under_test(device='all',
                                              host_os=self.host_os)

        for result in results:
            assert_less_equal(result, all_result)
コード例 #7
0
ファイル: test_linux.py プロジェクト: blin/zabby
    def test_fs_inodes_returns_tuple_of_integers_one_less_than_other(self):
        free, total = self.linux.fs_inodes(PRESENT_FILESYSTEM)

        assert_less_equal(free, total)
コード例 #8
0
ファイル: test_linux.py プロジェクト: blin/zabby
    def test_swap_size(self):
        free, total = self.linux.swap_size('all')

        assert_less_equal(free, total)
コード例 #9
0
ファイル: test_linux.py プロジェクト: blin/zabby
    def test_fs_inodes_returns_tuple_of_integers_one_less_than_other(self):
        free, total = self.linux.fs_inodes(PRESENT_FILESYSTEM)

        assert_less_equal(free, total)
コード例 #10
0
ファイル: test_linux.py プロジェクト: blin/zabby
    def test_swap_size(self):
        free, total = self.linux.swap_size('all')

        assert_less_equal(free, total)