test_fsutils.py 451 B

12345678910111213141516
  1. from larigira.fsutils import shortname
  2. def test_shortname_self():
  3. """sometimes, shortname is just filename without extension"""
  4. assert shortname("/tmp/asd/foo.bar") == "foo"
  5. def test_shortname_has_numbers():
  6. """shortname will preserve numbers"""
  7. assert shortname("/tmp/asd/foo1.bar") == "foo1"
  8. def test_shortname_has_no_hyphen():
  9. """shortname will not preserve hyphens"""
  10. assert shortname("/tmp/asd/foo-1.bar") == "foo1"