Esempio n. 1
0
    def test_flatten_noop_file(self):
        with tempfile.NamedTemporaryFile(mode="w") as test_file:
            test_file.write("[]")
            test_file.flush()

            self.assertEquals(flatten(trace_file=test_file.name), [])
Esempio n. 2
0
 def test_flatten_noop_str(self):
     self.assertEquals(flatten(trace_str="[]"), [])
Esempio n. 3
0
 def test_flatten_multiple_arguments_raises(self):
     with self.assertRaises(ValueError) as e:
         flatten(trace_file="a_file", trace_str="a_string")
     assert "Exactly one of" in str(e.exception)
Esempio n. 4
0
 def test_flatten_noop_file(self):
     self.assertEqual(flatten(trace_json=[]), [])
Esempio n. 5
0
 def test_flatten_no_arguments_raises(self):
     with self.assertRaises(ValueError) as e:
         flatten()
     assert "Exactly one of" in str(e.exception)