Пример #1
0
 def test_upload_id_valid(self):
     # _get_file_id is currently used for getting both file+upload IDs
     # since the spec for both is the same at present.
     upload_id = _get_file_id()
     self.assertTrue(
         FilepondFileUploader._upload_id_valid(upload_id),
         'A valid upload ID has been provided and this test should pass!')
Пример #2
0
 def test_upload_id_wrong_data_type(self):
     # _get_file_id is currently used for getting both file+upload IDs
     # since the spec for both is the same at present. Test using bytes
     # instead of str
     upload_id = _get_file_id().encode()
     self.assertFalse(
         FilepondFileUploader._upload_id_valid(upload_id),
         ('The provided upload ID is of the wrong data type, this test '
          'should fail.'))
Пример #3
0
 def test_upload_id_invalid(self):
     upload_id = 'sadadadasd'
     self.assertFalse(
         FilepondFileUploader._upload_id_valid(upload_id),
         'Invalid upload ID (wrong length) provided. Failure expected.')