Diff Test Cases - gpaOliveira/SuperDiffer GitHub Wiki

Obtained from file: SuperDiffer/tests/test_diff.py

Test cases to verify and document the Diff behavior on the controller and on the endpoint

[UNIT_TESTS] diff without any descriptors method

  • Given some value is saved
  • When the diff is requested without any descriptors to compare
  • Then None is returned

[UNIT_TESTS] diff with a single descriptors method

  • Given some value is saved
  • When the diff is requested with a single descriptors to compare
  • Then None is returned, as there are no pairs to compare

[UNIT_TESTS] diff without all descriptors method

  • Given some value is saved
  • When the diff between two descriptors is requested
  • Then None is returned, as not all the descriptors are found

[UNIT_TESTS] diff without id method

  • Given some values are saved
  • When the diff between two descriptors is requested with a different ID
  • Then None is returned

[UNIT_TESTS] diff not equal response method

  • Given some values are saved with different lenght of values
  • When the diff between those two descriptors is requested
  • Then a not equal response is returned, as the lenght of the values is different

[UNIT_TESTS] diff 1 char method

  • Given some values are saved with different lenght of values
  • When the diff between those two descriptors is requested
  • Then a not equal response is returned, as the lenght of the values is different

[UNIT_TESTS] diff 2 chars method

  • Given some values are saved with different lenght of values
  • When the diff between those two descriptors is requested
  • Then a not equal response is returned, as the lenght of the values is different

[UNIT_TESTS] diff 3 chars middle diff method

  • Given some values are saved with different lenght of values
  • When the diff between those two descriptors is requested
  • Then a not equal response is returned, as the lenght of the values is different

[UNIT_TESTS] diff 2 sequences begin middle method

  • Given some values are saved with different lenght of values
  • When the diff between those two descriptors is requested
  • Then a not equal response is returned, as the lenght of the values is different

[UNIT_TESTS] diff 2 sequences middle end method

  • Given some values are saved with different lenght of values
  • When the diff between those two descriptors is requested
  • Then a not equal response is returned, as the lenght of the values is different

[UNIT_TESTS] diff 3 sequences begin middle end method

  • Given some values are saved with different lenght of values
  • When the diff between those two descriptors is requested
  • Then a not equal response is returned, as the lenght of the values is different

[UNIT_TESTS] diff sequences on many ids request 1 method

  • Given some values are saved with different lenght of values on different IDs
  • When the diff between two descriptors on ID 1 is requested
  • Then a not equal response is returned, as the lenght of the values is different

[UNIT_TESTS] diff sequences on many ids request 2 method

  • Given some values are saved with different lenght of values on different IDs
  • When the diff between two descriptors on ID 2 is requested
  • Then a not equal response is returned, as the lenght of the values is different

[INTEGRATON_TESTS] diff integration only left value present method

  • Given Left description of ID = 1 is added but not the right one
  • When a diff is made asking for left and right of ID = 1
  • Then a 400 Bad Request is retrieved
  • And nothing changed on the databse

[INTEGRATON_TESTS] diff integration only right value present method

  • Given right descriptors of ID = 1 is added but not the left one
  • When a diff is made asking for left and right of ID = 1
  • Then a 400 Bad Request is retrieved
  • And nothing changed on the databse

[INTEGRATON_TESTS] diff integration left right different lenghts method

  • Given left and right descriptors of ID = 1 are added, but with different value lenghts
  • When a diff is made asking for left and right of ID = 1
  • Then a 200 is retrieved
  • And the response json states that the size is different
  • And the databse is empty

[INTEGRATON_TESTS] diff integration left right equal lenghts values method

  • Given left and right descriptors of ID = 1 are added, with equal values
  • When a diff is made asking for left and right of ID = 1
  • Then a 200 is retrieved
  • And the response json states that the size is different
  • And the databse is empty

[INTEGRATON_TESTS] diff integration left right 1 diff on values method

  • Given left and right descriptors of ID = 1 are added, with different values
  • When a diff is made asking for left and right of ID = 1
  • Then a 200 is retrieved
  • And the response json states that the size is different
  • And that the databse is empty

[INTEGRATON_TESTS] diff integration left right 1 diff on other values method

  • Given left and right descriptors of ID = 1 are added, with different values
  • And they're all added to the databae
  • When a diff is made asking for left and right of ID = 2
  • Then a 200 is retrieved
  • And the response json states that the size is different
  • And ID 2 data was removed from the database