def set_binary(self, binary: bytes): ''' See :meth:`objects.file.FileObject.set_binary`. :param binary: binary data of the file object :type binary: bytes ''' super().set_binary(binary) self._update_root_id_and_virtual_path() self.md5 = get_md5(binary)
def test_get_md5(): assert get_md5(TEST_STRING) == TEST_MD5, 'not correct from string'
def test_get_md5(self): self.assertEqual(get_md5(self.test_string), self.test_string_MD5, "not correct from string")
def set_binary(self, binary): super().set_binary(binary) self._update_root_id_and_virtual_path() self.md5 = get_md5(binary)