From: Zack Cerza Date: Tue, 10 May 2016 15:28:10 +0000 (-0600) Subject: Add run.Raw.__eq__() X-Git-Tag: 1.1.0~611^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c87638e568d3d6cae49ffdc847ecad4bd4543bd1;p=teuthology.git Add run.Raw.__eq__() Signed-off-by: Zack Cerza --- diff --git a/teuthology/orchestra/run.py b/teuthology/orchestra/run.py index 7f56900e..80b3b072 100644 --- a/teuthology/orchestra/run.py +++ b/teuthology/orchestra/run.py @@ -168,6 +168,9 @@ class Raw(object): value=self.value, ) + def __eq__(self, value): + return self.value == value + def quote(args): """ diff --git a/teuthology/orchestra/test/test_run.py b/teuthology/orchestra/test/test_run.py index 5132768c..40464f19 100644 --- a/teuthology/orchestra/test/test_run.py +++ b/teuthology/orchestra/test/test_run.py @@ -431,3 +431,10 @@ class TestRun(object): def test_quote_and_raw(self): got = run.quote(['true', run.Raw('&&'), 'echo', 'yay']) assert got == "true && echo yay" + + +class TestRaw(object): + def test_eq(self): + str_ = "I am a raw something or other" + raw = run.Raw(str_) + assert raw == run.Raw(str_)