Пример #1
0
 def test_fs_to_metric_prefix_stripping(self):
     in_ = "/mnt/data/whisper/servers/s0123/foo/bar.wsp"
     out = "servers.s0123.foo.bar"
     assert fs_to_metric(in_, prepend='/mnt/data/whisper') == out
     assert fs_to_metric(in_, prepend='/mnt/data/whisper/') == out
Пример #2
0
 def test_fs_to_metric_trailing_slash(self):
     in_ = "/servers/s0123/foo/bar.wsp/" # You never know...
     out = "servers.s0123.foo.bar"
     assert fs_to_metric(in_) == out
Пример #3
0
 def test_fs_to_metric_leading_slash(self):
     in_ = "/servers/s0123/foo/bar.wsp"
     out = "servers.s0123.foo.bar"
     assert fs_to_metric(in_) == out
Пример #4
0
 def test_fs_to_metric(self):
     in_ = "servers/s0123/foo/bar.wsp"
     out = "servers.s0123.foo.bar"
     assert fs_to_metric(in_) == out
Пример #5
0
 def test_fs_to_metric_prefix_stripping(self):
     in_ = "/mnt/data/whisper/servers/s0123/foo/bar.wsp"
     out = "servers.s0123.foo.bar"
     assert fs_to_metric(in_, prepend='/mnt/data/whisper') == out
     assert fs_to_metric(in_, prepend='/mnt/data/whisper/') == out
Пример #6
0
 def test_fs_to_metric_trailing_slash(self):
     in_ = "/servers/s0123/foo/bar.wsp/"  # You never know...
     out = "servers.s0123.foo.bar"
     assert fs_to_metric(in_) == out