atlas tool: testing via mocking (#18588)

* atlas: refactoring
* Atlas: do some basic testing via mocking
This commit is contained in:
Andreas Rumpf 2021-07-26 18:00:03 +02:00 • committed by GitHub
commit 664dbb6bfb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 387 additions and 58 deletions

View file

@ -3,14 +3,6 @@
import os, strutils, osproc
template withDir*(dir, body) =
let oldDir = getCurrentDir()
try:
setCurrentDir(dir)
body
finally:
setCurrentDir(oldDir)
proc isUrl*(x: string): bool =
x.startsWith("git://") or x.startsWith("https://") or x.startsWith("http://")