question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Create unit test for PastebinURLAnalyzer

See original GitHub issue

The current implementation of the PastebinURLAnalyzer did not get any unit tests yet. This should change now.

To resolve this task you need to create a new unit test file in the tests directory named pastebinurlanalyzer_test.py.

In this file implement at least 5 positive and 5 negative tests. The more the better! Make sure to test tricky combinations. Unit tests should really be testing code to its limits.

PS: It’s okay when tests make the build fail because the code is faulty! (It’s not okay if tests fail for no valid reason)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
d-Rickyy-bcommented, Oct 6, 2019

Since there were no unit tests yet it is possible that the current implementation is broken or faulty.

Only pastebin.com/something with http and https prefixed is a valid url.

It is okay when tests fail because of coding errors in pastepwn. That’s what tests are for right? 😊

1reaction
d-Rickyy-bcommented, Oct 6, 2019

You would need to copy the example.py from the examples directory. But that will only work when you got a pastebin pro account.

Better to run the unit tests independently with python -m unittest discover -s . -v -p "*_test.py"

Read more comments on GitHub >

github_iconTop Results From Across the Web

Has anyone managed to create unit tests for Django Rest ...
Has anyone managed to create unit tests for Django Rest Framework? ... I'm assuming it uses basic auth (for authentication protected views) but...
Read more >
Unit Testing of Spring MVC Controllers: REST API
It describes how you can write unit tests for a Spring MVC REST API with JUnit 5. Spring MVC provides an easy way...
Read more >
njRAT Spreading Through Active Pastebin Command and ...
Malware authors have been leveraging njRAT (AKA Bladabindi), a Remote Access trojan, to download and deliver second-stage payloads from ...
Read more >
Jorijn/pastebin-frontend: Yet to fill in. - GitHub
Shallow rendering is great for isolated unit tests, but you may still want to create some full rendering tests to ensure the components...
Read more >
System Design Mock Interview - Design Pastebin - 10/30/2021
Topic: Design Pastebin - Kaustubh as Interviewee and Satyam as an interviewer* Requirements * non functional requirements * capacity ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found