Пример #1
0
    def test_swap_device_names_skips_files(self, mock_lists):
        swap_file_path = '/mnt/swap_file'
        mock_lists.return_value = [[
            'Filename', 'Type', 'Size', 'Used', 'Priority'
        ], ['/dev/dm-0', 'partition', '10485756', '311756',
            '-1'], [swap_file_path, 'file', '524284', '0', '-2']]

        swap_devices = self.linux.swap_device_names()
        assert_not_in(swap_file_path.split('/')[-1], swap_devices)
Пример #2
0
    def test_swap_device_names_skips_files(self, mock_lists):
        swap_file_path = '/mnt/swap_file'
        mock_lists.return_value = [
            ['Filename', 'Type', 'Size', 'Used', 'Priority'],
            ['/dev/dm-0', 'partition', '10485756', '311756', '-1'],
            [swap_file_path, 'file', '524284', '0', '-2']]

        swap_devices = self.linux.swap_device_names()
        assert_not_in(swap_file_path.split('/')[-1], swap_devices)
Пример #3
0
 def test_floats_are_not_sent_in_scientific_notation(self):
     self.protocol.send_value(self.client, 1.06828003857e+12)
     sent_message = self.client.sendall.call_args[0][0]
     decoded_message = sent_message.decode('utf-8')
     assert_not_in('e+', decoded_message)
     assert_not_in('E+', decoded_message)