Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: tools/deep_memory_profiler/tests/range_dict_tests.py

Issue 19346002: Refactor dmprof: Split dmprof.py into modules. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/deep_memory_profiler/tests/dmprof_test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/deep_memory_profiler/tests/range_dict_tests.py
diff --git a/tools/deep_memory_profiler/tests/range_dict_tests.py b/tools/deep_memory_profiler/tests/range_dict_tests.py
index 4c7e50bd41820f06671fcba939e8820a5ef00ada..3bc2c139ac2425a21442fff323b1d86845e4e485 100755
--- a/tools/deep_memory_profiler/tests/range_dict_tests.py
+++ b/tools/deep_memory_profiler/tests/range_dict_tests.py
@@ -8,14 +8,14 @@ import os
import sys
import unittest
-ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
-sys.path.insert(0, ROOT_DIR)
+BASE_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+sys.path.append(BASE_PATH)
-import range_dict
+from lib.range_dict import ExclusiveRangeDict
class ExclusiveRangeDictTest(unittest.TestCase):
- class TestAttribute(range_dict.ExclusiveRangeDict.RangeAttribute):
+ class TestAttribute(ExclusiveRangeDict.RangeAttribute):
def __init__(self):
super(ExclusiveRangeDictTest.TestAttribute, self).__init__()
self._value = 0
@@ -38,7 +38,7 @@ class ExclusiveRangeDictTest(unittest.TestCase):
return new_attr
def test_init(self):
- ranges = range_dict.ExclusiveRangeDict(self.TestAttribute)
+ ranges = ExclusiveRangeDict(self.TestAttribute)
result = []
for begin, end, attr in ranges.iter_range(20, 40):
@@ -49,7 +49,7 @@ class ExclusiveRangeDictTest(unittest.TestCase):
self.assertEqual(expected, result)
def test_norange(self):
- ranges = range_dict.ExclusiveRangeDict(self.TestAttribute)
+ ranges = ExclusiveRangeDict(self.TestAttribute)
result = []
for begin, end, attr in ranges.iter_range(20, 20):
@@ -58,7 +58,7 @@ class ExclusiveRangeDictTest(unittest.TestCase):
self.assertEqual(expected, result)
def test_set(self):
- ranges = range_dict.ExclusiveRangeDict(self.TestAttribute)
+ ranges = ExclusiveRangeDict(self.TestAttribute)
for begin, end, attr in ranges.iter_range(20, 30):
attr.set(12)
for begin, end, attr in ranges.iter_range(30, 40):
@@ -74,7 +74,7 @@ class ExclusiveRangeDictTest(unittest.TestCase):
self.assertEqual(expected, result)
def test_split(self):
- ranges = range_dict.ExclusiveRangeDict(self.TestAttribute)
+ ranges = ExclusiveRangeDict(self.TestAttribute)
for begin, end, attr in ranges.iter_range(20, 30):
attr.set(1000)
for begin, end, attr in ranges.iter_range(30, 40):
@@ -105,7 +105,7 @@ class ExclusiveRangeDictTest(unittest.TestCase):
self.assertEqual(expected2, result2)
def test_fill(self):
- ranges = range_dict.ExclusiveRangeDict(self.TestAttribute)
+ ranges = ExclusiveRangeDict(self.TestAttribute)
for begin, end, attr in ranges.iter_range(30, 35):
attr.set(12345)
for begin, end, attr in ranges.iter_range(40, 45):
« no previous file with comments | « tools/deep_memory_profiler/tests/dmprof_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698