#5240 Adjust unit-test for: PagureFlaskApiIssuetests.test_api_view_issues_since
Opened 2 years ago by pingou. Modified a year ago

file modified
+5 -1
@@ -454,8 +454,12 @@ 

  

      updated_after = None

      if since:

+         try:

+             since = float(since)

+         except ValueError:

+             pass

          # Validate and convert the time

-         if since.isdigit():

+         if isinstance(since, float):

              # We assume its a timestamp, so convert it to datetime

              try:

                  updated_after = arrow.get(int(since)).datetime

@@ -2575,7 +2575,7 @@ 

                      "no_stones": None,

                      "order": None,

                      "priority": None,

-                     "since": str(start),

+                     "since": start,

                      "status": None,

                      "tags": [],

                  },
@@ -2614,7 +2614,7 @@ 

                      "no_stones": None,

                      "order": None,

                      "priority": None,

-                     "since": str(middle),

+                     "since": middle,

                      "status": None,

                      "tags": [],

                  },
@@ -2653,7 +2653,7 @@ 

                      "no_stones": None,

                      "order": None,

                      "priority": None,

-                     "since": str(final),

+                     "since": final,

                      "status": None,

                      "tags": [],

                  },
@@ -2696,7 +2696,7 @@ 

                      "no_stones": None,

                      "order": None,

                      "priority": None,

-                     "since": str(final),

+                     "since": final,

                      "status": None,

                      "tags": [],

                  },

Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr

fedora-rpms-py3 passed

rebased onto a5005f25f4ced92f6eec8ec65b8ede535f16bc72

2 years ago

@pingou This now conflicts with master, can you rebase it?

rebased onto eb1bc9311e10bd2fbb6c7040ec828b70c2fb2d50

a year ago

pretty please pagure-ci rebuild

a year ago

@pingou do we still need this PR? I'm asking because of my PR I'm working actively on to fix the unit test errors (https://pagure.io/pagure/pull-request/5365).
The test you address here is passing in f34 rpm and centos stream 8 rpm, in f34 pip I only have FAILED tests/test_pagure_flask_api_issue.py::PagureFlaskApiIssuetests::test_api_update_custom_field - AssertionError: 400 != 200 failing.

@wombelix the PR is a year old at this point, so I have to admit I don't quite remember what I was fixing with it, potentially the issue with pip you're facing or just an error I saw with float timestamps (instead of int).
Is it this patch that fails on f34 pip or is that test failing w/o the patch?

I didn't tested this code yet but as you can see in the other PR, there is way more failing in the existing tests as just this one you worked on. If you want I can put your changes into my PR as well? Right now there is so much failing in the jenkins ci tests if you run against master that it's probably impossible to see if your change would have an impact.

I didn't tested this code yet but as you can see in the other PR, there is way more failing in the existing tests as just this one you worked on. If you want I can put your changes into my PR as well? Right now there is so much failing in the jenkins ci tests if you run against master that it's probably impossible to see if your change would have an impact.

Then let's wait for your PR to land and I can always try a rebase afterward

rebased onto 68b39c7

a year ago