Skip to content

Commit

Permalink
Minifying tests
Browse files Browse the repository at this point in the history
  • Loading branch information
corey-nm committed Aug 26, 2022
1 parent f59f939 commit f90b33f
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions tests/sparsezoo/utils/test_authentication.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -37,18 +37,17 @@ def test_load_token_yaml_fail(tmp_path):
assert _maybe_load_token(path) is None


_OLD_DATE = (datetime.now() - timedelta(days=40)).timestamp()


@pytest.mark.parametrize(
"content",
[
{},
{CREDENTIALS_YAML_TOKEN_KEY: {}},
{CREDENTIALS_YAML_TOKEN_KEY: {"token": "asdf"}},
{CREDENTIALS_YAML_TOKEN_KEY: {"created": "asdf"}},
{
CREDENTIALS_YAML_TOKEN_KEY: {
"created": (datetime.now() - timedelta(days=40)).timestamp()
}
},
{CREDENTIALS_YAML_TOKEN_KEY: {"created": _OLD_DATE}},
],
)
def test_load_token_failure_cases(tmp_path, content):
Expand Down

0 comments on commit f90b33f

Please sign in to comment.