Esempio n. 1
0
 def test_validates(self):
     """
     Should validate if there is a valid instruction and name.
     """
     doc = InstructionDocument(creator_id=self.cid,
                               name='name',instruction={"load":"google.com"})
     doc.validate()
Esempio n. 2
0
 def test_requires_valid_instruction(self):
     """
     Should not validate without valid instruction.
     """
     doc = InstructionDocument(creator_id=self.cid,name='name',
                               instruction={"foo":"bar"})
     with self.assertRaises(ShieldException):
         doc.validate()
Esempio n. 3
0
 def test_requires_instruction(self):
     """
     Needs an instruction.
     """
     doc = InstructionDocument(creator_id=self.cid,
                               name='name')
     with self.assertRaises(ShieldException):
         doc.validate()
Esempio n. 4
0
 def test_requires_creator_id(self):
     """
     Needs a creator.
     """
     doc = InstructionDocument(instruction={"load": "google.com"},
                               name='name')
     with self.assertRaises(ShieldException):
         doc.validate()
Esempio n. 5
0
 def test_requires_name(self):
     """
     Needs a name.
     """
     doc = InstructionDocument(creator_id=self.cid,
                               instruction={"load": "google.com"})
     with self.assertRaises(ShieldException):
         doc.validate()