예제 #1
0
 def test_parse_line_with_underscores(self):
     """
     Tests that this line can properly pass. This was found to
     fail at some point in production.
     """
     p.parse_line(
         "hosts.lucid64.bi.metrics.tasks.update_session_create_counts:6.330013|ms"
     )
예제 #2
0
 def test_fails_no_type(self):
     """Tests that parsing fails for lines with no
     metric type."""
     with pytest.raises(ValueError):
         p.parse_line("k:27")
예제 #3
0
 def test_fails_no_value(self):
     """Tests that parsing fails for lines with no
     value (or key, depending on how you look at it)"""
     with pytest.raises(ValueError):
         p.parse_line("k|kv")
예제 #4
0
 def test_parses_float_flag(self):
     """Tests that float flags can be parsed."""
     assert ("k", 3, "ms", 0.1) == p.parse_line("k:3|ms|@0.1")
예제 #5
0
 def test_parses_float_value(self):
     """Tests that float values can be parsed."""
     assert ("k", 3.14, "ms", None) == p.parse_line("k:3.14|ms")
예제 #6
0
 def test_parses_negative_value(self):
     """Tests that lines can contain negative numbers as values."""
     assert ("k", -27, "ms", None) == p.parse_line("k:-27|ms")
예제 #7
0
 def test_parses_flag(self):
     """Tests that lines with flags (@ parameters) can be parsed
     properly."""
     assert ("k", 27, "ms", 123456) == p.parse_line("k:27|ms|@123456")
예제 #8
0
 def test_parses_negative_value(self):
     """Tests that lines can contain negative numbers as values."""
     assert ("k", -27, "ms", None) == p.parse_line("k:-27|ms")
예제 #9
0
 def test_parse_line_basic(self):
     """Tests the basic line type of: k:v|type"""
     assert ("k", 27, "kv", None) == p.parse_line("k:27|kv")
예제 #10
0
 def test_parse_line_with_underscores(self):
     """
     Tests that this line can properly pass. This was found to
     fail at some point in production.
     """
     p.parse_line("hosts.lucid64.bi.metrics.tasks.update_session_create_counts:6.330013|ms")
예제 #11
0
 def test_fails_negative_flag(self):
     """Tests that negative flags can not be parsed."""
     with pytest.raises(ValueError):
         p.parse_line("k:27|ms|@-24")
예제 #12
0
 def test_fails_no_type(self):
     """Tests that parsing fails for lines with no
     metric type."""
     with pytest.raises(ValueError):
         p.parse_line("k:27")
예제 #13
0
 def test_fails_no_value(self):
     """Tests that parsing fails for lines with no
     value (or key, depending on how you look at it)"""
     with pytest.raises(ValueError):
         p.parse_line("k|kv")
예제 #14
0
 def test_parses_float_flag(self):
     """Tests that float flags can be parsed."""
     assert ("k", 3, "ms", 0.1) == p.parse_line("k:3|ms|@0.1")
예제 #15
0
 def test_parses_float_value(self):
     """Tests that float values can be parsed."""
     assert ("k", 3.14, "ms", None) == p.parse_line("k:3.14|ms")
예제 #16
0
 def test_fails_negative_flag(self):
     """Tests that negative flags can not be parsed."""
     with pytest.raises(ValueError):
         p.parse_line("k:27|ms|@-24")
예제 #17
0
 def test_parse_line_basic(self):
     """Tests the basic line type of: k:v|type"""
     assert ("k", 27, "kv", None) == p.parse_line("k:27|kv")
예제 #18
0
 def test_parses_flag(self):
     """Tests that lines with flags (@ parameters) can be parsed
     properly."""
     assert ("k", 27, "ms", 123456) == p.parse_line("k:27|ms|@123456")