Example #1
0
def test_file_size_does_not_equal_to_other_type():
    assert FileSize(1) != 1
Example #2
0
def test_file_size_tb():
    filesize = FileSize(1458000256012)
    assert str(filesize) == "1.33 TB"
Example #3
0
def test_file_size_undefined():
    assert str(FileSize(sys.maxsize ** 10)) == "Undefined"
    assert str(FileSize(-1)) == "Undefined"
Example #4
0
def test_file_size_0():
    filesize = FileSize(0)
    assert str(filesize) == "0 Byte"
Example #5
0
def test_file_size_over_1k():
    filesize = FileSize(2048)
    assert str(filesize) == "2.00 KB"
Example #6
0
def test_file_size_for_1_char():
    filesize = FileSize(1)
    assert str(filesize) == "1 Byte"
Example #7
0
def test_file_size_human_readable_display():
    filesize = FileSize(999)
    assert str(filesize) == "999.00 Bytes"
Example #8
0
def test_get_size_in_bytes():
    fileview = FileView("Sample.java")
    assert fileview.size == FileSize(150)