You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,8 @@ This demo project is not cover all test cases for the HTTP operations and all RD
26
26
27
27
A unit test helps developers to isolate what is broken in their application easier and faster than testing an entire system as a whole. It is the first level of testing done during the development process before integration testing. It is mostly done by the developers automated or manually to verify their code.
28
28
29
+

30
+
29
31
You can find more detail about the unit test concept from the following resources:
30
32
-[Python Guide: Testing Your Code](https://docs.python-guide.org/writing/tests/) article.
31
33
-[How and when to use Unit Testing properly](https://softwareengineering.stackexchange.com/questions/89064/how-and-when-to-use-unit-testing-properly) post.
@@ -90,10 +92,13 @@ RDP APIs give developers seamless and holistic access to all of the Refinitiv co
90
92
91
93
This example project is focusing on the Request-Response: RESTful web service delivery method only.
92
94
95
+

96
+
93
97
For more detail regarding the Refinitiv Data Platform, please see the following APIs resources:
## <aid="testsuite_detail"></a>Test Suit Development Detail
98
103
99
104
Please see the full details over the test suite implementation on the [unittest-article.md](unittest-article.md) file.
@@ -129,11 +134,11 @@ The first step is to unzip or download the example project folder into a directo
129
134
```
130
135
(http_unittest) $>pip install -r requirements.txt
131
136
```
132
-
5. Once the dependencies installation process success, Go to the project's *tests* folder, then run the following command to run the ```test_rdp_http_controller.py``` test suite.
137
+
5. Once the dependencies installation process is success, Go to the project's *tests* folder, then run the following command to run the ```test_rdp_http_controller.py``` test suite.

183
187
184
188
That covers how to run an example test suite.
185
189
186
190
## <a id="summary"></a>Conclusion and Next Steps
187
191
188
192
Unit testing is now the mandatory process of a software development lifecycle for both modern and legacy applications. It helps to expose unintentional behaviors of a tiny part of the application quicker than trying to find bugs in a big complex phase. It speeds up the overall feedback loop and improves trust among the project team. Unit testing also helps improves application source code quality, developers have more confidence in refactoring the source code for better performance and cleaner code. As the author of this article, I also have learned a lot from this project. There are a lot of error handlers or code logic that I never think of until I started to write unit test cases.
189
193
190
-
This example project demonstrates the manual unit testing method. However, developers should run unit test cases automatically every time they made changes to the code (or configurations). The most practical technique is running automated unit tests as part of the developers' Continuous Integration/Continuous Delivery (CI/CD) pipeline. Developers can apply the TDD (Test-driven development) practice that writing and correcting the failed tests before writing new code with their project too.
194
+
This example project demonstrates the manual unit testing method. However, developers should run unit test cases automatically every time they made changes to the code (or configurations). The most practical technique is running automated unit tests as part of the developers' Continuous Integration/Continuous Delivery (CI/CD) pipeline. Developers can apply the TDD (Test-driven development) approach that writing and correcting the failed tests before writing new code with their project too.
195
+
196
+

191
197
192
198
The [unittest](https://docs.python.org/3.9/library/unittest.html) framework and [Responses](https://github.com/getsentry/responses) mocking library are very good starting points to learn a unit test with [Python](https://www.python.org/) and build a simple test suite to test HTTP operations source code. If developers need more advanced features, they can explore other Python unit test frameworks such as [pytest](https://docs.pytest.org/en/7.1.x/), [nose2](https://github.com/nose-devs/nose2), or [doctest](https://github.com/doctest/doctest).
193
199
194
200
At the same time, the [Refinitiv Data Platform (RDP) APIs](https://developers.refinitiv.com/en/api-catalog/refinitiv-data-platform/refinitiv-data-platform-apis) provide various Refinitiv data and content for developers via an easy-to-use Web-based API. The APIs are easy to integrate into any application and platform that supports the HTTP protocol and JSON message format.
195
201
196
-
197
202
## <a id="references"></a>References
198
203
199
204
That brings me to the end of my unit test example project. For further details, please check out the following resources:
0 commit comments