Exemple #1
0
    def test_output_format_ordereddict_list_not_sorted(self):
        obj1 = OrderedDict()
        obj1['B'] = 1
        obj1['A'] = 2

        obj2 = OrderedDict()
        obj2['A'] = 3
        obj2['B'] = 4
        result = format_tsv(CommandResultItem([obj1, obj2]))
        self.assertEqual(result, '1\t2\n3\t4\n')
    def test_output_format_ordereddict_list_not_sorted(self):
        obj1 = OrderedDict()
        obj1['B'] = 1
        obj1['A'] = 2

        obj2 = OrderedDict()
        obj2['A'] = 3
        obj2['B'] = 4
        result = format_tsv(CommandResultItem([obj1, obj2]))
        self.assertEqual(result, '1\t2\n3\t4\n')
Exemple #3
0
 def test_output_format_ordereddict_not_sorted(self):
     obj = OrderedDict()
     obj['B'] = 1
     obj['A'] = 2
     result = format_tsv(CommandResultItem(obj))
     self.assertEqual(result, '1\t2\n')
Exemple #4
0
 def test_output_format_dict_sort(self):
     obj = {}
     obj['B'] = 1
     obj['A'] = 2
     result = format_tsv(CommandResultItem(obj))
     self.assertEqual(result, '2\t1\n')
 def test_output_format_ordereddict_not_sorted(self):
     obj = OrderedDict()
     obj['B'] = 1
     obj['A'] = 2
     result = format_tsv(CommandResultItem(obj))
     self.assertEqual(result, '1\t2\n')
 def test_output_format_dict_sort(self):
     obj = {}
     obj['B'] = 1
     obj['A'] = 2
     result = format_tsv(CommandResultItem(obj))
     self.assertEqual(result, '2\t1\n')