Ejemplo n.º 1
0
    def test_enforcementjob(self):
        conv = xmlconverter.EnforcementConverter()

        current = xmlconverter.convertstring(conv, self.ejob1)
        expected = wsag_model.EnforcementJob("$id", True)
        self.assertEquals(current, expected)

        current = xmlconverter.convertstring(conv, self.ejob2)
        expected = wsag_model.EnforcementJob("$id", False)
        self.assertEquals(current, expected)
Ejemplo n.º 2
0
    def test_enforcementjob(self):
        conv = xmlconverter.EnforcementConverter()

        current = xmlconverter.convertstring(conv, self.ejob1)
        expected = wsag_model.EnforcementJob("$id", True)
        self.assertEquals(current, expected)

        current = xmlconverter.convertstring(conv, self.ejob2)
        expected = wsag_model.EnforcementJob("$id", False)
        self.assertEquals(current, expected)
Ejemplo n.º 3
0
    def test_template(self):
        slatemplate = slaclient.templates.fed4fire.render_slatemplate(
            self.templateinput)
        # convert xml to wsag_model classes
        actual = xmlconverter.convertstring(self.converter, slatemplate)
        """:type: wsag_model.Template"""

        expected = self.templateinput

        self.assertEquals(expected.template_id, actual.template_id)
        self._check_common(expected, actual)
        print slatemplate
Ejemplo n.º 4
0
    def test_agreement(self):
        slaagreement = slaclient.templates.fed4fire.render_slaagreement(
            self.agreementinput)
        # convert xml to wsag_model classes
        actual = xmlconverter.convertstring(self.converter, slaagreement)
        """:type: wsag_model.Agreement"""

        expected = self.agreementinput

        self.assertEquals(expected.agreement_id, actual.agreement_id)
        expected.consumer and self.assertEquals(expected.consumer,
                                                actual.context.consumer)
        self._check_common(expected, actual)
        self._check_guarantee_terms(expected, actual)
        print slaagreement
Ejemplo n.º 5
0
	def test_template(self):
		slatemplate = slaclient.templates.xifi.render_slatemplate(
			self.templateinput
		)
		# convert xml to wsag_model classes
		actual = xmlconverter.convertstring(self.converter, slatemplate)
		""":type: wsag_model.Template"""

		expected = self.templateinput

		self.assertEquals(
			expected.template_id,
			actual.template_id
		)
		self._check_common(expected, actual)
		print slatemplate
Ejemplo n.º 6
0
	def test_agreement(self):
		slaagreement = slaclient.templates.xifi.render_slaagreement(
			self.agreementinput
		)
		# convert xml to wsag_model classes
		actual = xmlconverter.convertstring(self.converter, slaagreement)
		""":type: wsag_model.Agreement"""

		expected = self.agreementinput

		self.assertEquals(
			expected.agreement_id,
			actual.agreement_id
		)
		expected.consumer and self.assertEquals(
			expected.consumer,
			actual.context.consumer
		)
		self._check_common(expected, actual)
		self._check_guarantee_terms(expected, actual)
		print slaagreement
Ejemplo n.º 7
0
    def test_penalty_with_empty_fields(self):
        conv = xmlconverter.PenaltyConverter()

        current = xmlconverter.convertstring(conv, self.penalty2)
        pprint(current)
Ejemplo n.º 8
0
    def test_penalty(self):
        conv = xmlconverter.PenaltyConverter()

        current = xmlconverter.convertstring(conv, self.penalty1)
        pprint(current)
Ejemplo n.º 9
0
 def test_violation(self):
     conv = xmlconverter.ViolationConverter()
     out = xmlconverter.convertstring(conv, self.violation)
Ejemplo n.º 10
0
 def test_provider(self):
     conv = xmlconverter.ProviderConverter()
     out = xmlconverter.convertstring(conv, self.provider)
Ejemplo n.º 11
0
	def test_list(self):
		conv = xmlconverter.ListConverter(xmlconverter.ProviderConverter())
		out = xmlconverter.convertstring(conv, self.list)
Ejemplo n.º 12
0
	def test_provider(self):
		conv = xmlconverter.ProviderConverter()
		out = xmlconverter.convertstring(conv, self.provider)
Ejemplo n.º 13
0
 def test_penalties(self):
     conv = xmlconverter.ListConverter(xmlconverter.PenaltyConverter())
     out = xmlconverter.convertstring(conv, self.penalties)
     pprint(out)
Ejemplo n.º 14
0
    def test_penalty_with_empty_fields(self):
        conv = xmlconverter.PenaltyConverter()

        current = xmlconverter.convertstring(conv, self.penalty2)
        pprint(current)
Ejemplo n.º 15
0
    def test_penalty(self):
        conv = xmlconverter.PenaltyConverter()

        current = xmlconverter.convertstring(conv, self.penalty1)
        pprint(current)
Ejemplo n.º 16
0
 def test_penalties(self):
     conv = xmlconverter.ListConverter(xmlconverter.PenaltyConverter())
     out = xmlconverter.convertstring(conv, self.penalties)
     pprint(out)
Ejemplo n.º 17
0
 def test_list(self):
     conv = xmlconverter.ListConverter(xmlconverter.ProviderConverter())
     out = xmlconverter.convertstring(conv, self.list)
     pprint(out)
Ejemplo n.º 18
0
	def test_violation(self):
		conv = xmlconverter.ViolationConverter()
		out = xmlconverter.convertstring(conv, self.violation)