'Test that we can create a new object.'

def testCreateObject(self):

    path = '/C.0123456789abcdef/foo/bar/hello.txt'
    fd = aff4.FACTORY.Create(path, aff4.AFF4MemoryStream, token=self.token)
    fd.Flush()
    fd.Write('hello')
    fd.Close()
    fd = aff4.FACTORY.Open(path, token=self.token)
    self.assertEqual(fd.Read(100), 'hello')
    for path in ['aff4:/C.0123456789abcdef', 'aff4:/C.0123456789abcdef/foo', 'aff4:/C.0123456789abcdef/foo/bar', 'aff4:/C.0123456789abcdef/foo/bar/hello.txt']:
        fd = aff4.FACTORY.Open(path, token=self.token)
        last = fd.Get(fd.Schema.LAST)
        self.assertGreater(int(last), 1330354592221974)
