def test_show_filesize(self): html = show_filesize(100) ok_(isinstance(html, SafeText)) eq_( html, '100 bytes' ) html = show_filesize(10000) ok_(isinstance(html, SafeText)) eq_( html, '10,000 bytes ' '<span class="humanized" title="10,000 bytes">' '(9.77 KB)</span>' ) html = show_filesize('10000') ok_(isinstance(html, SafeText)) eq_( html, '10,000 bytes ' '<span class="humanized" title="10,000 bytes">' '(9.77 KB)</span>' )
def test_show_filesize(self): html = show_filesize(100) assert isinstance(html, SafeText) assert html == "100 bytes" html = show_filesize(10000) assert isinstance(html, SafeText) expected = ("10,000 bytes " '<span class="humanized" title="10,000 bytes">' "(10 KB)</span>") assert html == expected html = show_filesize("10000") assert isinstance(html, SafeText) expected = ("10,000 bytes " '<span class="humanized" title="10,000 bytes">' "(10 KB)</span>") assert html == expected
def test_show_filesize(self): html = show_filesize(100) assert isinstance(html, SafeText) assert html == '100 bytes' html = show_filesize(10000) assert isinstance(html, SafeText) expected = ('10,000 bytes ' '<span class="humanized" title="10,000 bytes">' '(10 KB)</span>') assert html == expected html = show_filesize('10000') assert isinstance(html, SafeText) expected = ('10,000 bytes ' '<span class="humanized" title="10,000 bytes">' '(10 KB)</span>') assert html == expected
def test_show_filesize(self): html = show_filesize(100) ok_(isinstance(html, SafeText)) eq_(html, '100 bytes') html = show_filesize(10000) ok_(isinstance(html, SafeText)) eq_( html, '10,000 bytes ' '<span class="humanized" title="10,000 bytes">' '(9.77 KB)</span>') html = show_filesize('10000') ok_(isinstance(html, SafeText)) eq_( html, '10,000 bytes ' '<span class="humanized" title="10,000 bytes">' '(9.77 KB)</span>')
def test_show_filesize(self): html = show_filesize(100) assert isinstance(html, SafeText) assert html == '100 bytes' html = show_filesize(10000) assert isinstance(html, SafeText) expected = ( '10,000 bytes ' '<span class="humanized" title="10,000 bytes">' '(10 KB)</span>' ) assert html == expected html = show_filesize('10000') assert isinstance(html, SafeText) expected = ( '10,000 bytes ' '<span class="humanized" title="10,000 bytes">' '(10 KB)</span>' ) assert html == expected
def test_show_filesize_failing(self): html = show_filesize(None) assert html is None html = show_filesize("junk") assert html == "junk"
def test_show_filesize_failing(self): html = show_filesize(None) eq_(html, None) html = show_filesize('junk') eq_(html, 'junk')
def test_show_filesize_failing(self): html = show_filesize(None) assert html is None html = show_filesize('junk') assert html == 'junk'