diff --git a/testing/marionette/client/marionette_driver/marionette.py b/testing/marionette/client/marionette_driver/marionette.py index b9123cac1122..c153dcbd306c 100644 --- a/testing/marionette/client/marionette_driver/marionette.py +++ b/testing/marionette/client/marionette_driver/marionette.py @@ -207,6 +207,10 @@ class HTMLElement(object): def __eq__(self, other_element): return self.id == other_element.id + def __hash__(self): + # pylint --py3k: W1641 + return hash(self.id) + def find_element(self, method, target): """Returns an ``HTMLElement`` instance that matches the specified method and target, relative to the current element. diff --git a/testing/marionette/client/marionette_driver/transport.py b/testing/marionette/client/marionette_driver/transport.py index 679b14562fd7..1cdc777d9d25 100644 --- a/testing/marionette/client/marionette_driver/transport.py +++ b/testing/marionette/client/marionette_driver/transport.py @@ -36,6 +36,10 @@ class Message(object): def __ne__(self, other): return not self.__eq__(other) + def __hash__(self): + # pylint --py3k: W1641 + return hash(self.id) + class Command(Message): TYPE = 0 diff --git a/testing/mozbase/mozinfo/mozinfo/string_version.py b/testing/mozbase/mozinfo/mozinfo/string_version.py index 02739920c260..b1b434c49a53 100644 --- a/testing/mozbase/mozinfo/mozinfo/string_version.py +++ b/testing/mozbase/mozinfo/mozinfo/string_version.py @@ -53,6 +53,10 @@ class StringVersion(six.text_type): if self.version > other.version: return 1 + def __hash__(self): + # pylint --py3k: W1641 + return hash(self.version) + # operator overloads def __eq__(self, other): return self._cmp(other) == 0 diff --git a/testing/mozbase/mozprofile/mozprofile/permissions.py b/testing/mozbase/mozprofile/mozprofile/permissions.py index 362491c98c71..5d456bf93fa9 100644 --- a/testing/mozbase/mozprofile/mozprofile/permissions.py +++ b/testing/mozbase/mozprofile/mozprofile/permissions.py @@ -110,6 +110,10 @@ class Location(object): __eq__ = isEqual + def __hash__(self): + # pylint --py3k: W1641 + return hash(tuple(getattr(attr) for attr in self.attrs)) + def url(self): return "%s://%s:%s" % (self.scheme, self.host, self.port) diff --git a/testing/mozharness/external_tools/tooltool.py b/testing/mozharness/external_tools/tooltool.py index 3747e57e95aa..7fa40e5880db 100755 --- a/testing/mozharness/external_tools/tooltool.py +++ b/testing/mozharness/external_tools/tooltool.py @@ -497,6 +497,19 @@ class FileRecord(object): def __ne__(self, other): return not self.__eq__(other) + def __hash__(self): + # pylint --py3k: W1641 + return hash( + ( + self.filename, + self.size, + self.digest, + self.algorithm, + self.version, + self.visibility, + ) + ) + def __str__(self): return repr(self) @@ -669,6 +682,10 @@ class Manifest(object): def __ne__(self, other): return not self.__eq__(other) + def __hash__(self): + # pylint --py3k: W1641 + return hash(tuple(sorted((fr.filename, fr) for fr in self.file_records))) + def __deepcopy__(self, memo): # This is required for a deep copy return Manifest(self.file_records[:])