Skip to content

[bug] OSS - wrong sequence of unit tests #16

@Magnus-COWI

Description

@Magnus-COWI

test_get_object_details() fails for me because it is called before test_upload_object_buff(). Therefor no unittest.txt file exists in the bucket.
This happens because the sequence of methods are alphabetical.

An improvement might be to add a testSuite. But I have no experience using it.
https://stackoverflow.com/a/36430378

    def test_upload_object_buff(self):
        buff = bytes('This is a test...', 'utf-8')
        obj = self.client.upload_object(FORGE_BUCKET, 'unittest.txt', buff)
        assert obj

    def test_upload_object_file(self):
        with open(__file__, 'rb') as file:
            obj = self.client.upload_object(FORGE_BUCKET, 'unittest.py', file)
            assert obj

    def test_get_object_details(self): #NOTE: called before test_upload_object_buff()
        details = self.client.get_object_details(FORGE_BUCKET, 'unittest.txt')
        assert 'objectKey' in details

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions