diff options
author | nicolargo <nicolashennion@gmail.com> | 2024-06-09 17:40:28 +0200 |
---|---|---|
committer | nicolargo <nicolashennion@gmail.com> | 2024-06-09 17:40:28 +0200 |
commit | 051006e12f7c90281dda4af60871b535b0dcdcb9 (patch) | |
tree | a1e82346883046c0ba609a273b51b19cfc8d0fc2 /unittest-core.py | |
parent | 4862264a2a139b6d33b681610b2fdac6426aab5c (diff) |
test test_107_fs_plugin_method fails on aarch64-linux #2819
Diffstat (limited to 'unittest-core.py')
-rwxr-xr-x | unittest-core.py | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/unittest-core.py b/unittest-core.py index 848989b9..c061d6e3 100755 --- a/unittest-core.py +++ b/unittest-core.py @@ -119,7 +119,7 @@ class TestGlances(unittest.TestCase): current_stats['foo'] = 'bar' current_stats = plugin_instance.filter_stats(current_stats) self.assertTrue('foo' not in current_stats) - elif isinstance(plugin_instance.get_raw(), list): + elif isinstance(plugin_instance.get_raw(), list) and len(plugin_instance.get_raw()) > 0: current_stats[0]['foo'] = 'bar' current_stats = plugin_instance.filter_stats(current_stats) self.assertTrue('foo' not in current_stats[0]) @@ -133,34 +133,36 @@ class TestGlances(unittest.TestCase): if plugin_instance.history_enable(): if isinstance(plugin_instance.get_raw(), dict): first_history_field = plugin_instance.get_items_history_list()[0]['name'] - elif isinstance(plugin_instance.get_raw(), list): + elif isinstance(plugin_instance.get_raw(), list) and len(plugin_instance.get_raw()) > 0: first_history_field = '_'.join( [ plugin_instance.get_raw()[0][plugin_instance.get_key()], plugin_instance.get_items_history_list()[0]['name'], ] ) - self.assertEqual(len(plugin_instance.get_raw_history(first_history_field)), 2) - self.assertGreater( - plugin_instance.get_raw_history(first_history_field)[1][0], - plugin_instance.get_raw_history(first_history_field)[0][0], - ) + if len(plugin_instance.get_raw()) > 0: + self.assertEqual(len(plugin_instance.get_raw_history(first_history_field)), 2) + self.assertGreater( + plugin_instance.get_raw_history(first_history_field)[1][0], + plugin_instance.get_raw_history(first_history_field)[0][0], + ) # Update stats (add third element) plugin_instance.update() plugin_instance.update_stats_history() plugin_instance.update_views() - self.assertEqual(len(plugin_instance.get_raw_history(first_history_field)), 3) - self.assertEqual(len(plugin_instance.get_raw_history(first_history_field, 2)), 2) - self.assertIsInstance(json.loads(plugin_instance.get_stats_history()), dict) + if len(plugin_instance.get_raw()) > 0: + self.assertEqual(len(plugin_instance.get_raw_history(first_history_field)), 3) + self.assertEqual(len(plugin_instance.get_raw_history(first_history_field, 2)), 2) + self.assertIsInstance(json.loads(plugin_instance.get_stats_history()), dict) # Check views self.assertIsInstance(plugin_instance.get_views(), dict) if isinstance(plugin_instance.get_raw(), dict): self.assertIsInstance(plugin_instance.get_views(first_history_field), dict) self.assertTrue('decoration' in plugin_instance.get_views(first_history_field)) - elif isinstance(plugin_instance.get_raw(), list): + elif isinstance(plugin_instance.get_raw(), list) and len(plugin_instance.get_raw()) > 0: first_history_field = plugin_instance.get_items_history_list()[0]['name'] first_item = plugin_instance.get_raw()[0][plugin_instance.get_key()] self.assertIsInstance(plugin_instance.get_views(item=first_item, key=first_history_field), dict) |