Дополнить общий контракт границ осей
This commit is contained in:
4
c/set-protocol/tests/fixtures/plot-v1.json
vendored
4
c/set-protocol/tests/fixtures/plot-v1.json
vendored
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": 1,
|
||||
"version": 2,
|
||||
"cases": [
|
||||
{"name":"zoom_x_anchor","op":0,"input":[0,0,1,1,2,1,0,0,0.25,0.5],"output":[0.125,0,0.5,1]},
|
||||
{"name":"zoom_y_anchor","op":0,"input":[0,0,1,1,1,4,0,0,0.5,0.75],"output":[0,0.5625,1,0.25]},
|
||||
@@ -23,6 +23,8 @@
|
||||
{"name":"db_gain","op":7,"input":[1,10],"output":[20]},
|
||||
{"name":"db_attenuation","op":7,"input":[10,1],"output":[-20]},
|
||||
{"name":"db_zero_reference","op":7,"input":[0,1],"output":null},
|
||||
{"name":"absolute_limits","op":8,"input":[0,500,-2,2],"output":[0,500,-2,2]},
|
||||
{"name":"reversed_x_limits","op":8,"input":[1,1,-2,2],"output":null},
|
||||
{"name":"zero_range","op":2,"input":[1,1,1,0],"output":null},
|
||||
{"name":"zero_pixels","op":4,"input":[0,1,0,0,1,0],"output":null},
|
||||
{"name":"bad_viewport","op":0,"input":[0,0,0,1,2,1,0,0,0.5,0.5],"output":null}
|
||||
|
||||
@@ -56,6 +56,9 @@ class PlotTests(unittest.TestCase):
|
||||
self.assertAlmostEqual(20, self.core.db_delta(1, 10))
|
||||
self.assertAlmostEqual(-20, self.core.db_delta(10, 1))
|
||||
self.assertIsNone(self.core.db_delta(0, 1))
|
||||
self.assertEqual(Bounds(0, 500, -2, 2), self.core.limits(0, 500, -2, 2))
|
||||
with self.assertRaises(ValueError):
|
||||
self.core.limits(1, 1, -2, 2)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user