| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 70ec8e9 commit e88bb1e
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -43,7 +43,7 @@ | |||
| 43 | 43 | ||
| 44 | 44 | ALL_MODES = (SIMPLE, SUBSTRING, FUZZY) | |
| 45 | 45 | ||
| 46 | - MAGIC_METHODS = ("__%s__" % s for s in ( | ||
| 46 | + MAGIC_METHODS = tuple("__%s__" % s for s in ( | ||
| 47 | 47 | "init", "repr", "str", "lt", "le", "eq", "ne", "gt", "ge", "cmp", "hash", | |
| 48 | 48 | "nonzero", "unicode", "getattr", "setattr", "get", "set", "call", "len", | |
| 49 | 49 | "getitem", "setitem", "iter", "reversed", "contains", "add", "sub", "mul", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -187,3 +187,12 @@ class TestAttrCompletion(unittest.TestCase): | |||
| 187 | 187 | def test_att_matches_found_on_instance(self): | |
| 188 | 188 | com = autocomplete.AttrCompletion() | |
| 189 | 189 | self.assertSetEqual(com.matches(2, 'a.', {'a': Foo()}), set(['a.method', 'a.a', 'a.b'])) | |
| 190 | + | ||
| 191 | + class TestMagicMethodCompletion(unittest.TestCase): | ||
| 192 | + | ||
| 193 | + def test_magic_methods_complete_after_double_underscores(self): | ||
| 194 | + com = autocomplete.MagicMethodCompletion() | ||
| 195 | + block = "class Something(object)\n def __" | ||
| 196 | + self.assertSetEqual(com.matches(10, ' def __', block), set(autocomplete.MAGIC_METHODS)) | ||
| 197 | + | ||
| 198 | + | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments