def setUp(self):
     x509 = genmodels.X509Attestation(TEST_CERT1)
     self.gen_att = genmodels.AttestationMechanism(X509_LABEL, x509=x509)
     self.gen_twin = genmodels.InitialTwin()
     gen_eg = genmodels.EnrollmentGroup(TEST_REG_ID, self.gen_att, TEST_HOST_NAME, \
         self.gen_twin, TEST_ETAG, PROV_STATUS_ENABLED, TEST_TIME, TEST_TIME2)
     self.eg = EnrollmentGroup(gen_eg)
 def test_eg_constructor_min_model(self):
     x509 = genmodels.X509Attestation()
     att = genmodels.AttestationMechanism(X509_LABEL, x509=x509)
     eg = genmodels.EnrollmentGroup(TEST_REG_ID, att)
     ret = EnrollmentGroup(eg)
     self.assertIsInstance(ret, EnrollmentGroup)
     self.assertIs(ret._internal, eg)
     self.assertIsInstance(ret._att_wrapper, AttestationMechanism)
     self.assertIs(ret._att_wrapper._internal, att)
     self.assertIsNone(ret._twin_wrapper)
 def test_eg_constructor_full_model(self):
     x509 = genmodels.X509Attestation()
     att = genmodels.AttestationMechanism(X509_LABEL, x509=x509)
     twin = genmodels.InitialTwin()
     eg = genmodels.EnrollmentGroup(TEST_REG_ID, att, TEST_HOST_NAME, twin, TEST_ETAG, \
         PROV_STATUS_ENABLED, TEST_TIME, TEST_TIME2)
     ret = EnrollmentGroup(eg)
     self.assertIsInstance(ret, EnrollmentGroup)
     self.assertIs(ret._internal, eg)
     self.assertIsInstance(ret._att_wrapper, AttestationMechanism)
     self.assertIs(ret._att_wrapper._internal, att)
     self.assertIsInstance(ret._twin_wrapper, InitialTwin)
     self.assertIs(ret._twin_wrapper._internal, twin)