Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rizac committed Jun 25, 2023
1 parent 6de4056 commit b537b84
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,12 @@ Install the program: From the directory where you cloned `mecompute`:

## Usage:

First of all, you should configure your routine. In the repository a
`config` directory is available with all configuration files already setup:
you can use it (for developers: it's ignored by `git`) or copy it elsewhere:
the only configuration file to be customized is `download.yaml` (all other files
are already setup with defaults).
Open `download.yaml`, setup `dburl` the database URL (postgres) or file (sqlite)
where the waveforms and metadata downloaded from the event (parameter `events_url`)
and dataselect (`data_url`) FDSN web services, and all other parameters, if needed.
First of all, you should configure your download routine. In the repository a
`config` directory (git-ignored) is available, with all configuration files already
setup: you can use the directory or copy it elsewhere: it contains several configuration
files, already filled with default values and that should be modified by experienced
users: the only configuration file that need to be customized is `download.yaml`
(see below)


### Events and data Download:
Expand Down Expand Up @@ -159,7 +156,7 @@ specified directory with start and end time encoded in the directory name:

### Misc

#### Generating tests
#### Run tests and generate test data

Run:
```commandline
Expand All @@ -168,5 +165,5 @@ pytest ./me-compute/test

Note that there is only one test routine generating files in a `test/tmp` directory
(git-ignored). The directory is **not** deleted automatically in order to leave
developers the ability to perform a further visual test on the generated output
developers the ability to perform an additional visual test on the generated output
(e.g. HTML report)
4 changes: 2 additions & 2 deletions test/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ def test_process(params, capsys):
# get modification times to check we overwrote those files
# (if files do not exist, set yesterday as modification time):
m_times = {
f: datetime.utcnow() - timedelta(days=1) if not isfile(f) else
os.stat(f).st_mtime for f in [s_hdf, s_log, csv, log, html, xml]
f: -1. if not isfile(f) else os.stat(f).st_mtime
for f in [s_hdf, s_log, csv, log, html, xml]
}

result = runner.invoke(cli, ['-f',
Expand Down

0 comments on commit b537b84

Please sign in to comment.