summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudiu Popa <cpopa@cloudbasesolutions.com>2015-07-01 19:22:16 +0300
committerClaudiu Popa <cpopa@cloudbasesolutions.com>2015-07-01 19:22:16 +0300
commit4969386ea3325d07be8de687aa90b03b7f885cde (patch)
tree1cbc052f82d87b53f03e59e80e4d2682b52a8002
parentef3f3fea80feb16e959d39116b1d4e8e05564112 (diff)
downloadastroid-4969386ea3325d07be8de687aa90b03b7f885cde.tar.gz
Add test for indexing strings.
-rw-r--r--astroid/tests/unittest_inference.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/astroid/tests/unittest_inference.py b/astroid/tests/unittest_inference.py
index c1c58fa..9968107 100644
--- a/astroid/tests/unittest_inference.py
+++ b/astroid/tests/unittest_inference.py
@@ -670,9 +670,10 @@ class InferenceTest(resources.SysPathSetup, unittest.TestCase):
[1, 2, 3][0] + (2, )[0] + (3, )[-1] #@
e = {'key': 'value'}
e['key'] #@
+ "first"[0] #@
'''
ast_nodes = test_utils.extract_node(code, __name__)
- expected = [1, 2, 3, 6, 'value']
+ expected = [1, 2, 3, 6, 'value', 'f']
for node, expected_value in zip(ast_nodes, expected):
inferred = next(node.infer())
self.assertIsInstance(inferred, nodes.Const)