示例#1
0
    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)
示例#2
0
def test_get_md5():
    assert get_md5(TEST_STRING) == TEST_MD5, 'not correct from string'
示例#3
0
 def test_get_md5(self):
     self.assertEqual(get_md5(self.test_string), self.test_string_MD5,
                      "not correct from string")
示例#4
0
 def set_binary(self, binary):
     super().set_binary(binary)
     self._update_root_id_and_virtual_path()
     self.md5 = get_md5(binary)