manu-chroma / username-availability-checker

Live at : https://username-check.herokuapp.com/
96 stars 37 forks source link

Add Travis testing using pytest #31

Closed jayvdb closed 6 years ago

jayvdb commented 6 years ago

Run tests to confirm that the algorithms used produce correct results for existing known usernames and non-existing (but valid usernames).

The usernames for each case need to be stored in a test data file.

If the known non-existent username becomes existent according to the algorithm, it may mean the username has become taken, or the algorithm used has become invalid. Include a basic random nonsense username generator to try again using a different username. If the nonsense username is found to be non-existent, the test should still error, but provide a message which suggests that the nonsense username should be manually checked and used as a replacement in the test data.

manu-chroma commented 6 years ago

We should have async requests in tests to speed up checking, otherwise tests will be slow and non-scalable.

manu-chroma commented 6 years ago

@jayvdb just a wild idea, would it make sense to write username tests in js, given how easy it would be to make async calls and assert accordingly?

I think it would become overly complex and cumbersome when coming to python

manu-chroma commented 6 years ago

also, this issue is assigned to @andrewda

andrewda commented 6 years ago

Just wrote about 3-4 tests for each platform and it takes less than 8 seconds for all of them to pass. Async requests probably aren't necessary.

manu-chroma commented 6 years ago

Interesting. Feel free to create a [WIP] PR We can discuss more tomorrow.