Ejemplo n.º 1
0
 def test_valid(self):
     names = list_secret_names('{"version": "1.0", "secrets": ["one", "two"]}')
     self.assertEqual(names, ["one", "two"])
Ejemplo n.º 2
0
 def test_invalid_version(self):
     with self.assertRaisesRegex(ValueError, "incompatible protocol version 2.0"):
         list_secret_names('{"version": "2.0"}')
Ejemplo n.º 3
0
 def test_not_list(self):
     with self.assertRaisesRegex(ValueError, "should be an array"):
         list_secret_names('{"version": "1.0", "secrets": "one"}')
Ejemplo n.º 4
0
 def test_invalid_output(self):
     with self.assertRaisesRegex(
         ValueError, r"Expecting value: line 1 column 1 \(char 0\)"
     ):
         list_secret_names("")