forked from Smartling/api-sdk-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathINSTALL.txt
More file actions
69 lines (48 loc) · 1.96 KB
/
Copy pathINSTALL.txt
File metadata and controls
69 lines (48 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
File API sdk is ready to be used 'as is'.
All necessary files are in smartlingApiSdk.
So you could place directory smartlingApiSdk someplace in your project and use it as shown in example.
Example.
Example script is placed in separate directory named 'example'.
It should give you a examples of initializing API and using api calls.
To run example you should set up smartling credentials for your project like this:
use environment variables:
export SL_LOCALE=**-**
export SL_USER_IDENTIFIER=******************************
export SL_USER_SECRET=*******************************************************
#optional
export SL_ACCOUNT_UID=******* #required only to list projects api call
export SL_PROJECT_ID=******* #required for api calls `projects` and `project_details`
or set credential explicitly in class smartlingApiSdk/Credentials.py
After credentials are set do:
cd example
python SimpleExample.py
or
python IntermediateExample.py
or
python AdvancedExample.py
or
python ProjectsExample.py
Tests.
Test uses nose python framework.
Information about installing nose is here http://readthedocs.org/docs/nose/en/latest.
Nose framework is used for test only and is not necessary for file API SDK to be used.
To run test do following:
obtain api key and project id from smartling
export api key, project id, locale:
export SL_API_KEY=********-****-****-****-************
export SL_PROJECT_ID=*********
export SL_LOCALE=**-**
export SL_USER_IDENTIFIER=******************************
export SL_USER_SECRET=*******************************************************
export SL_ACCOUNT_UID=******* #required only to list projects api call
cd test
nosetests testFapiV2.py
Correct tests output looks like this:
nosetests testFapiV2.py
...................
----------------------------------------------------------------------
Ran 19 tests in 110.315s
OK
export SL_API_KEY=********-****-****-****-************ is necessary for v1 api tests :
testFAPI.py
test_Import.py