Repository: meraki-analytics/cassiopeia

Issue:
Patch comparison bug
The bug is simply that this line `cass.Patch.from_str("9.9")<cass.Patch.from_str("9.10")` returns false.
This is because the major and minor properties are strings and not integers, so the comparison `"9"<"10"` is false.

Discussion:

Patch:
diff --git a/cassiopeia/core/patch.py b/cassiopeia/core/patch.py
index 7963694..9ba9f76 100644
--- a/cassiopeia/core/patch.py
+++ b/cassiopeia/core/patch.py
@@ -146,7 +146,7 @@ class Patch(object):
         return self.name == other.name
 
     def __lt__(self, other: "Patch") -> bool:
-        if self.major < other.major or (self.major == other.major and self.minor < other.minor):
+        if int(self.major) < int(other.major) or (self.major == other.major and int(self.minor) < int(other.minor)):
             return True
         else:
             return False


Test patch:
diff --git a/test/test_patches.py b/test/test_patches.py
index 921a390..39efe24 100644
--- a/test/test_patches.py
+++ b/test/test_patches.py
@@ -16,3 +16,9 @@ def test_unknown_patch_raises():
 def test_season_start_end_using_patches():
     assert Season.season_7.start(Region.north_america) == Patch.from_str("7.1", region=Region.north_america).start
     assert Season.season_8.end(Region.north_america) == None
+
+
+def test_patch_relational_operators():
+    assert Patch.from_str("9.9", region="NA") < Patch.from_str("9.10", region="NA")
+    assert Patch.from_str("8.20", region="NA") > Patch.from_str("8.11", region="NA")
+    assert Patch.from_str("8.20", region="NA") > Patch.from_str("8.3", region="NA")