about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | qemu partition disk imageSilvino Silva2016-10-081-6/+20
| | |
| * | core scripts revisionSilvino Silva2016-10-086-198/+227
| | |
| * | dev git revisionSilvino Silva2016-10-082-86/+133
| | |
| * | bumped new release 0.2.4Silvino Silva2016-10-
import pytest
import operator

from ranger.container.fsobject import FileSystemObject


class MockFM(object):
    """Used to fullfill the dependency by FileSystemObject."""

    default_linemodes = []


def create_filesystem_object(path):
    """Create a FileSystemObject without an fm object."""
    fso = FileSystemObject.__new__(FileSystemObject)
    fso.fm = MockFM()
    fso.__init__(path)
    return fso


def test_basename_natural1():
    """Test filenames without extensions."""
    fsos = [create_filesystem_object(path)
            for path in "hello", "hello1", "hello2"]
    assert(fsos == sorted(fsos[::-1], key=operator.attrgetter("basename_natural")))
    assert(fsos == sorted(fsos[::-1], key=operator.attrgetter("basename_natural_lower")))


def test_basename_natural2():
    """Test filenames with extensions."""
    fsos = [create_filesystem_object(path)
            for path in "hello", "hello.txt", "hello1.txt", "hello2.txt"]
    assert(fsos == sorted(fsos[::-1], key=operator.attrgetter("basename_natural")))
    assert(fsos == sorted(fsos[::-1], key=operator.attrgetter("basename_natural_lower")))
/doc/commit/?id=ba6cbac7b30288ac5582f37a3e0e1ba323b83b75'>Merge branch 'f-net' into develop
Silvino Silva2016-09-2810-84/+303
|\ \
| * | network revisionSilvino Silva2016-09-2810-84/+303
|/ /
* | core network revisionSilvino Silva2016-09-281-1/+43
| |
* | Merge branch 'f-auto-nginx' into developSilvino Silva2016-09-2813-102/+547
|\ \
| * | nginx revision with mantisbtSilvino Silva2016-09-283-9/+31
| | |
| * | tools index revisionSilvino Silva2016-09-281-6/+6
| | |
| * | tools nginx fix script installSilvino Silva2016-09-282-6/+14
| | |
| * | nginx configuration fixSilvino Silva2016-09-282-2/+2
| | |
| * | tool ningx revision, added install scriptsSilvino Silva2016-09-2810-92/+507
| | |
* | | core rc.d/net revisionSilvino Silva2016-09-281-2/+1
|/ /
* | network name revisionSilvino Silva2016-09-283-21/+18
| |
* | Merge branch 'f-core-net' into developSilvino Silva2016-09-285-48/+56
|\ \
| * | new core network configurationSilvino Silva2016-09-285-48/+56
|/ /
* | develop merge r0.2.2Silvino Silva2016-09-248-68/+113
|\ \
* \ \ Merge branch 'r-0.2.1' into developSilvino Silva2016-09-2233-330/+31496
|\ \ \
| | | * release 'r-0.2.2'Silvino Silva2016-09-249-69/+114
| | | |\ | | | |/ | | |/|
| | * | Final revision 0.2.2Silvino Silva2016-09-245-50/+92
| | | |
| | * | tar backup script fixSilvino Silva2016-09-222-5/+8
| | | |
| | * | tools qemu and index document fixSilvino Silva2016-09-222-13/+12
| | | |
| | * | tools tar document fixSilvino Silva2016-09-221-1/+1
| | | |
| | * | tools gnupg document fixSilvino Silva2016-09-221-3/+4
| | | |
| | * | bumped new revision 0.2.2Silvino Silva2016-09-221-1/+1
| | |/
| | * release 0.2.1Silvino Silva2016-09-2259-362/+31984
| | |\ | | |/ | |/|
| * | final 0.2.1 revisionSilvino Silva2016-09-2211-187/+615
| | |
| * | Merge branch 'b-mail-system' into r-0.2.1Silvino Silva2016-09-214-30/+62
| |\ \
| | * | initial exim and mutt local delivery testSilvino Silva2016-09-214-30/+62
| | | |
| * | | Merge branch 'b-dns' into r-0.2.1Silvino Silva2016-09-215-5/+29503
| |\ \ \ | | |/ / | |/| |
| | * | dnsmasq and dnscrypt revisionSilvino Silva2016-09-215-12002/+28656
| | | |
| | * | initial dnsmasq configurationSilvino Silva2016-09-212-0/+12844
| |/ /
| * | tools qemu revisionSilvino Silva2016-09-211-51/+50
| | |
| * | tools dnsmasq revisionSilvino Silva2016-09-211-3/+3
| | |