コード例 #1
0
ファイル: test_models.py プロジェクト: talos/caustic-server
 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()
コード例 #2
0
ファイル: test_models.py プロジェクト: talos/caustic-server
 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()
コード例 #3
0
ファイル: test_models.py プロジェクト: talos/caustic-server
 def test_requires_instruction(self):
     """
     Needs an instruction.
     """
     doc = InstructionDocument(creator_id=self.cid,
                               name='name')
     with self.assertRaises(ShieldException):
         doc.validate()
コード例 #4
0
ファイル: test_models.py プロジェクト: talos/caustic-server
 def test_requires_creator_id(self):
     """
     Needs a creator.
     """
     doc = InstructionDocument(instruction={"load": "google.com"},
                               name='name')
     with self.assertRaises(ShieldException):
         doc.validate()
コード例 #5
0
ファイル: test_models.py プロジェクト: talos/caustic-server
 def test_requires_name(self):
     """
     Needs a name.
     """
     doc = InstructionDocument(creator_id=self.cid,
                               instruction={"load": "google.com"})
     with self.assertRaises(ShieldException):
         doc.validate()