File tree 2 files changed +35
-2
lines changed
2 files changed +35
-2
lines changed Original file line number Diff line number Diff line change 18
18
# ------------------------------------------------------------------------
19
19
20
20
import sys , os .path
21
- IS_PY3 = sys .version_info [0 ] < 3
22
- if IS_PY3 :
21
+ IS_PY3 = sys .version_info [0 ] > 2
22
+ if not IS_PY3 :
23
+ # importing required py2 modules
23
24
import xmlrpclib
24
25
# in py 3 encodestring is deprecated and an alias for encodebytes
25
26
# see issue #39 and compare py2 py3 doc
26
27
# https://docs.python.org/2/library/base64.html#base64.encodestring
27
28
# https://docs.python.org/3/library/base64.html#base64.encodebytes
28
29
from base64 import encodestring as encodebytes
29
30
else :
31
+ # importing required py3 modules
30
32
import xmlrpc .client as xmlrpclib
31
33
from base64 import encodebytes
32
34
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/python
2
+ # -*- coding: UTF-8 -*-
3
+
4
+ # Copyright 2018 Luiko Czub, TestLink-API-Python-client developers
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+ # ------------------------------------------------------------------------
19
+
20
+ # TestCases for Testlink API clients handling py2 and py3 differences
21
+ # - TestlinkAPIClient, TestlinkAPIGeneric
22
+ #
23
+
24
+ import pytest
25
+ #from conftest import api_general_client, api_generic_client
26
+
27
+ def test_IS_PY3_same_state ():
28
+ from testlink .proxiedtransport import IS_PY3 as proxie_is_py3
29
+ from testlink .testlinkapigeneric import IS_PY3 as tl_is_py3
30
+ assert proxie_is_py3 == tl_is_py3
31
+
You can’t perform that action at this time.
0 commit comments