aboutsummaryrefslogtreecommitdiffstats
path: root/octopart_test.go
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2012-09-21 13:03:46 +0200
committerbnewbold <bnewbold@robocracy.org>2012-09-21 13:03:46 +0200
commit575dd002be18f170917a98f8bca891b4bd615f78 (patch)
tree5db7245e184110fd0a403b052191fe6d5b3205d4 /octopart_test.go
parentb0ecc94ef69d489dcc775038a0c6f65c1c960c8e (diff)
downloadbommom-575dd002be18f170917a98f8bca891b4bd615f78.tar.gz
bommom-575dd002be18f170917a98f8bca891b4bd615f78.zip
basic octopart pricing functionality
Diffstat (limited to 'octopart_test.go')
-rw-r--r--octopart_test.go16
1 files changed, 10 insertions, 6 deletions
diff --git a/octopart_test.go b/octopart_test.go
index d2c8fbd..c86ed9b 100644
--- a/octopart_test.go
+++ b/octopart_test.go
@@ -26,7 +26,7 @@ func TestGetMarketInfoList(t *testing.T) {
if r == nil {
log.Printf("\t%d: %s", i, "nil")
} else {
- log.Printf("\t%d: %s", i, r.(map[string]interface{})["detail_url"])
+ log.Printf("\t%d: %s", i, r["detail_url"])
}
}
log.Println("Running a second time, results should be cached...")
@@ -38,7 +38,7 @@ func TestGetMarketInfoList(t *testing.T) {
if r == nil {
log.Printf("\t%d: %s", i, "nil")
} else {
- log.Printf("\t%d: %s", i, r.(map[string]interface{})["detail_url"])
+ log.Printf("\t%d: %s", i, r["detail_url"])
}
}
log.Println("Running in single mode, result should be cached...")
@@ -47,9 +47,9 @@ func TestGetMarketInfoList(t *testing.T) {
t.Errorf("Error with api call: " + err.Error())
}
if result_single == nil {
- log.Printf("\t%d: %s", "nil")
+ log.Printf("\t%d: %s", 0, "nil")
} else {
- log.Printf("\t%d: %s", result_single["detail_url"])
+ log.Printf("\t%d: %s", 0, result_single["detail_url"])
}
}
@@ -58,6 +58,10 @@ func TestAttachInfo(t *testing.T) {
bm := &BomMeta{}
oc := NewOctopartClient("")
oc.AttachMarketInfoBom(b)
- t.Errorf("unimplemented")
- DumpBomAsText(bm, b, os.Stdout)
+ //t.Errorf("unimplemented")
+ //DumpBomAsText(bm, b, os.Stdout)
+ DumpBomMarketInfo(bm, b, os.Stdout)
+ log.Println("Running a second time, results should be cached...")
+ oc.AttachMarketInfoBom(b)
+ DumpBomMarketInfo(bm, b, os.Stdout)
}