[pypy-commit] pypy cpyext-macros-cast: Revert name changes in tests.
devin.jeanpierre
pypy.commits at gmail.com
Wed May 11 17:09:54 EDT 2016
Author: Devin Jeanpierre <jeanpierreda at gmail.com>
Branch: cpyext-macros-cast
Changeset: r84389:56ebebbb88b9
Date: 2016-05-11 10:34 -0700
http://bitbucket.org/pypy/pypy/changeset/56ebebbb88b9/
Log: Revert name changes in tests.
diff --git a/pypy/module/cpyext/test/test_datetime.py b/pypy/module/cpyext/test/test_datetime.py
--- a/pypy/module/cpyext/test/test_datetime.py
+++ b/pypy/module/cpyext/test/test_datetime.py
@@ -10,9 +10,9 @@
assert api.PyDate_Check(w_date)
assert api.PyDate_CheckExact(w_date)
- assert api._PyDateTime_GET_YEAR(w_date) == 2010
- assert api._PyDateTime_GET_MONTH(w_date) == 6
- assert api._PyDateTime_GET_DAY(w_date) == 3
+ assert api.PyDateTime_GET_YEAR(w_date) == 2010
+ assert api.PyDateTime_GET_MONTH(w_date) == 6
+ assert api.PyDateTime_GET_DAY(w_date) == 3
def test_time(self, space, api):
w_time = api.PyTime_FromTime(23, 15, 40, 123456)
@@ -21,10 +21,10 @@
assert api.PyTime_Check(w_time)
assert api.PyTime_CheckExact(w_time)
- assert api._PyDateTime_TIME_GET_HOUR(w_time) == 23
- assert api._PyDateTime_TIME_GET_MINUTE(w_time) == 15
- assert api._PyDateTime_TIME_GET_SECOND(w_time) == 40
- assert api._PyDateTime_TIME_GET_MICROSECOND(w_time) == 123456
+ assert api.PyDateTime_TIME_GET_HOUR(w_time) == 23
+ assert api.PyDateTime_TIME_GET_MINUTE(w_time) == 15
+ assert api.PyDateTime_TIME_GET_SECOND(w_time) == 40
+ assert api.PyDateTime_TIME_GET_MICROSECOND(w_time) == 123456
def test_datetime(self, space, api):
w_date = api.PyDateTime_FromDateAndTime(
@@ -36,13 +36,13 @@
assert api.PyDate_Check(w_date)
assert not api.PyDate_CheckExact(w_date)
- assert api._PyDateTime_GET_YEAR(w_date) == 2010
- assert api._PyDateTime_GET_MONTH(w_date) == 6
- assert api._PyDateTime_GET_DAY(w_date) == 3
- assert api._PyDateTime_DATE_GET_HOUR(w_date) == 23
- assert api._PyDateTime_DATE_GET_MINUTE(w_date) == 15
- assert api._PyDateTime_DATE_GET_SECOND(w_date) == 40
- assert api._PyDateTime_DATE_GET_MICROSECOND(w_date) == 123456
+ assert api.PyDateTime_GET_YEAR(w_date) == 2010
+ assert api.PyDateTime_GET_MONTH(w_date) == 6
+ assert api.PyDateTime_GET_DAY(w_date) == 3
+ assert api.PyDateTime_DATE_GET_HOUR(w_date) == 23
+ assert api.PyDateTime_DATE_GET_MINUTE(w_date) == 15
+ assert api.PyDateTime_DATE_GET_SECOND(w_date) == 40
+ assert api.PyDateTime_DATE_GET_MICROSECOND(w_date) == 123456
def test_delta(self, space, api):
w_delta = space.appexec(
@@ -57,9 +57,9 @@
assert api.PyDelta_Check(w_delta)
assert api.PyDelta_CheckExact(w_delta)
- assert api._PyDateTime_DELTA_GET_DAYS(w_delta) == 10
- assert api._PyDateTime_DELTA_GET_SECONDS(w_delta) == 20
- assert api._PyDateTime_DELTA_GET_MICROSECONDS(w_delta) == 30
+ assert api.PyDateTime_DELTA_GET_DAYS(w_delta) == 10
+ assert api.PyDateTime_DELTA_GET_SECONDS(w_delta) == 20
+ assert api.PyDateTime_DELTA_GET_MICROSECONDS(w_delta) == 30
def test_fromtimestamp(self, space, api):
w_args = space.wrap((0,))
diff --git a/pypy/module/cpyext/test/test_floatobject.py b/pypy/module/cpyext/test/test_floatobject.py
--- a/pypy/module/cpyext/test/test_floatobject.py
+++ b/pypy/module/cpyext/test/test_floatobject.py
@@ -6,7 +6,7 @@
def test_floatobject(self, space, api):
assert space.unwrap(api.PyFloat_FromDouble(3.14)) == 3.14
assert api.PyFloat_AsDouble(space.wrap(23.45)) == 23.45
- assert api._PyFloat_AS_DOUBLE(space.wrap(23.45)) == 23.45
+ assert api.PyFloat_AS_DOUBLE(space.wrap(23.45)) == 23.45
assert api.PyFloat_AsDouble(space.w_None) == -1
api.PyErr_Clear()
diff --git a/pypy/module/cpyext/test/test_intobject.py b/pypy/module/cpyext/test/test_intobject.py
--- a/pypy/module/cpyext/test/test_intobject.py
+++ b/pypy/module/cpyext/test/test_intobject.py
@@ -9,7 +9,7 @@
assert not api.PyInt_Check(space.wrap((1, 2, 3)))
for i in [3, -5, -1, -sys.maxint, sys.maxint - 1]:
x = api.PyInt_AsLong(space.wrap(i))
- y = api._PyInt_AS_LONG(space.wrap(i))
+ y = api.PyInt_AS_LONG(space.wrap(i))
assert x == i
assert y == i
w_x = api.PyInt_FromLong(x + 1)
diff --git a/pypy/module/cpyext/test/test_listobject.py b/pypy/module/cpyext/test/test_listobject.py
--- a/pypy/module/cpyext/test/test_listobject.py
+++ b/pypy/module/cpyext/test/test_listobject.py
@@ -22,9 +22,9 @@
def test_get_size(self, space, api):
l = api.PyList_New(0)
- assert api._PyList_GET_SIZE(l) == 0
+ assert api.PyList_GET_SIZE(l) == 0
api.PyList_Append(l, space.wrap(3))
- assert api._PyList_GET_SIZE(l) == 1
+ assert api.PyList_GET_SIZE(l) == 1
def test_size(self, space, api):
l = space.newlist([space.w_None, space.w_None])
diff --git a/pypy/module/cpyext/test/test_sequence.py b/pypy/module/cpyext/test/test_sequence.py
--- a/pypy/module/cpyext/test/test_sequence.py
+++ b/pypy/module/cpyext/test/test_sequence.py
@@ -14,8 +14,8 @@
w_l = space.wrap([1, 2, 3, 4])
assert api.PySequence_Fast(w_l, "message") is w_l
- assert space.int_w(api._PySequence_Fast_GET_ITEM(w_l, 1)) == 2
- assert api._PySequence_Fast_GET_SIZE(w_l) == 4
+ assert space.int_w(api.PySequence_Fast_GET_ITEM(w_l, 1)) == 2
+ assert api.PySequence_Fast_GET_SIZE(w_l) == 4
w_set = space.wrap(set((1, 2, 3, 4)))
w_seq = api.PySequence_Fast(w_set, "message")
@@ -130,7 +130,7 @@
result = api.PySequence_GetItem(w_l, 4)
assert space.is_true(space.eq(result, space.wrap(4)))
- result = api._PySequence_ITEM(w_l, 4)
+ result = api.PySequence_ITEM(w_l, 4)
assert space.is_true(space.eq(result, space.wrap(4)))
self.raises(space, api, IndexError, api.PySequence_GetItem, w_l, 9000)
diff --git a/pypy/module/cpyext/test/test_setobject.py b/pypy/module/cpyext/test/test_setobject.py
--- a/pypy/module/cpyext/test/test_setobject.py
+++ b/pypy/module/cpyext/test/test_setobject.py
@@ -14,7 +14,7 @@
w_set = space.call_function(space.w_set)
space.call_method(w_set, 'update', space.wrap([1,2,3,4]))
assert api.PySet_Size(w_set) == 4
- assert api._PySet_GET_SIZE(w_set) == 4
+ assert api.PySet_GET_SIZE(w_set) == 4
raises(TypeError, api.PySet_Size(space.newlist([])))
api.PyErr_Clear()
diff --git a/pypy/module/cpyext/test/test_unicodeobject.py b/pypy/module/cpyext/test/test_unicodeobject.py
--- a/pypy/module/cpyext/test/test_unicodeobject.py
+++ b/pypy/module/cpyext/test/test_unicodeobject.py
@@ -133,10 +133,10 @@
class TestUnicode(BaseApiTest):
def test_unicodeobject(self, space, api):
- assert api._PyUnicode_GET_SIZE(space.wrap(u'sp�m')) == 4
+ assert api.PyUnicode_GET_SIZE(space.wrap(u'sp�m')) == 4
assert api.PyUnicode_GetSize(space.wrap(u'sp�m')) == 4
unichar = rffi.sizeof(Py_UNICODE)
- assert api._PyUnicode_GET_DATA_SIZE(space.wrap(u'sp�m')) == 4 * unichar
+ assert api.PyUnicode_GET_DATA_SIZE(space.wrap(u'sp�m')) == 4 * unichar
encoding = rffi.charp2str(api.PyUnicode_GetDefaultEncoding())
w_default_encoding = space.call_function(
@@ -160,7 +160,7 @@
def test_AS(self, space, api):
word = space.wrap(u'spam')
array = rffi.cast(rffi.CWCHARP, api.PyUnicode_AS_DATA(word))
- array2 = api._PyUnicode_AS_UNICODE(word)
+ array2 = api.PyUnicode_AS_UNICODE(word)
array3 = api.PyUnicode_AsUnicode(word)
for (i, char) in enumerate(space.unwrap(word)):
assert array[i] == char
@@ -498,13 +498,13 @@
count1 = space.int_w(space.len(w_x))
target_chunk = lltype.malloc(rffi.CWCHARP.TO, count1, flavor='raw')
- x_chunk = api._PyUnicode_AS_UNICODE(w_x)
+ x_chunk = api.PyUnicode_AS_UNICODE(w_x)
api.Py_UNICODE_COPY(target_chunk, x_chunk, 4)
w_y = space.wrap(rffi.wcharpsize2unicode(target_chunk, 4))
assert space.eq_w(w_y, space.wrap(u"abcd"))
- size = api._PyUnicode_GET_SIZE(w_x)
+ size = api.PyUnicode_GET_SIZE(w_x)
api.Py_UNICODE_COPY(target_chunk, x_chunk, size)
w_y = space.wrap(rffi.wcharpsize2unicode(target_chunk, size))
More information about the pypy-commit
mailing list