def test_sign_minimal(self):
    builder = EventBuilder({'event_id': '$0:domain', 'origin': 'domain', 'origin_server_ts': 1000000, 'signatures': {}, 'type': 'X', 'unsigned': {'age_ts': 1000000}})
    add_hashes_and_signatures(builder, HOSTNAME, self.signing_key)
    event = builder.build()
    self.assertTrue(hasattr(event, 'hashes'))
    self.assertIn('sha256', event.hashes)
    self.assertEquals(event.hashes['sha256'], '6tJjLpXtggfke8UxFhAKg82QVkJzvKOVOOSjUDK4ZSI')
    self.assertTrue(hasattr(event, 'signatures'))
    self.assertIn(HOSTNAME, event.signatures)
    self.assertIn(KEY_NAME, event.signatures['domain'])
    self.assertEquals(event.signatures[HOSTNAME][KEY_NAME], '2Wptgo4CwmLo/Y8B8qinxApKaCkBG2fjTWB7AbP5Uy+aIbygsSdLOFzvdDjww8zUVKCmI02eP9xtyJxc/cLiBA')
def test_sign_minimal(self):
    builder = EventBuilder({'event_id': '$0:domain', 'origin': 'domain', 'origin_server_ts': 1000000, 'signatures': {}, 'type': 'X', 'unsigned': {'age_ts': 1000000}})
    add_hashes_and_signatures(builder, HOSTNAME, self.signing_key)
    event = builder.build()
    self.assertTrue(hasattr(event, 'hashes'))
    self.assertIn('sha256', event.hashes)
    self.assertEquals(event.hashes['sha256'], '6tJjLpXtggfke8UxFhAKg82QVkJzvKOVOOSjUDK4ZSI')
    self.assertTrue(hasattr(event, 'signatures'))
    self.assertIn(HOSTNAME, event.signatures)
    self.assertIn(KEY_NAME, event.signatures['domain'])
    self.assertEquals(event.signatures[HOSTNAME][KEY_NAME], '2Wptgo4CwmLo/Y8B8qinxApKaCkBG2fjTWB7AbP5Uy+aIbygsSdLOFzvdDjww8zUVKCmI02eP9xtyJxc/cLiBA')