github.com/cloudbase/juju-core@v0.0.0-20140504232958-a7271ac7912f/state/apiserver/keymanager/testing/fakesshimport.go (about) 1 // Copyright 2013 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package testing 5 6 import ( 7 "strings" 8 9 sshtesting "launchpad.net/juju-core/utils/ssh/testing" 10 ) 11 12 var importResponses = map[string]string{ 13 "lp:validuser": sshtesting.ValidKeyThree.Key, 14 "lp:existing": sshtesting.ValidKeyTwo.Key, 15 } 16 17 var FakeImport = func(keyId string) (string, error) { 18 response, ok := importResponses[keyId] 19 if ok { 20 return strings.Join([]string{"INFO: line1", response, "INFO: line3"}, "\n"), nil 21 } 22 return "INFO: line", nil 23 }